ReportViewer - Programmatically Customize Chart Axes at Runtime

Is there any way to access the chart inside a reportviewer to customize the chart Y-max at runtime. Some times my data has outliers and I would like the user to be able to specify the Y-max manually.

Failing this, I'll have to generate an .rdlc dynamically and assign it to the reportviewer.



Answer this question

ReportViewer - Programmatically Customize Chart Axes at Runtime

  • Deuce Loosely

    In format chart->grid->scales->Use manual setting for Max and Min value, we can specify constant value.
    Is there any way we can assign some paramter here so that I can pass those values as parameters to line chart. I am not clear whether something like that is mentioned in above solution. I am using .net 1.1 and crystal report 8.5 for line chart


  • vikrant

    Is this option available when using local mode, localreport ( not using SQL Server Reporting Services )

    Thanks,

    Bunk


  • shadow_woman

    I am using the ReportViewer Control for the first time and I cannot figure out what is wrong with what I am doing.
    I wish to generate graphs on my asp page. I am using the reportviewercontrol (local processing mode) which have the data sources being called from methods in DAL.

    ReportViewer2.ProcessingMode = ProcessingMode.Local;
    ReportViewer2.LocalReport.ReportEmbeddedResource = "Report2.rdlc";
    ReportDataSource ds = new ReportDataSource();
    ds.Name = "DataSet2_DataTable1";
    ds.Value = MyMethod(id,numberOfresponses).Tables[0];----> MyMethod returns a dataset
    ReportViewer2.LocalReport.DataSources.Add(ds);
    ReportViewer2.LocalReport.Refresh();
    ReportViewer2.Visible = true;

    There is nothing wrong with MyMethod() because I am using the same to show data in a Gridview control. But I have problems using the same with ReportViewer Control.

    I added an empty ReportViewerWebControl.axd in the root file but still it does give me an error like this in all the reportviewer contorls I am using.

    Server Application Unavailable

    The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

    Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.



    In Report2.rdlc I am defining the chart and values but I am passing the values from ReportViewer Datasource to the chart and DataSet2_DataTable1.I am not even sure if I am doing it in the right way but I just tried this following some tutorials.



    Could you please suggest me how to make this work



    Thank You


  • GapToN

    I'm not sure I understand your question.

    The (RS) ReportViewer controls are based on the Report Definition Language (RDLC). You have access to all chart RDL capabilities in local mode including the ability to use an expression to determine axis settings.

    -- Robert



  • Brent McCulloch

    This is the forum for the Visual Studio ReportViewer controls (based on SQL Server Reporting Services). My suggestions apply to Reporting Services - not to Crystal Reports.

    For Crystal Reports you have to ask your question in the Forum for Crystal Reports.

    -- Robert



  • elargento

    The y-axis maximum value can be set to an expression. E.g. =Parameters!P1.Value

    Note: if the expression evaluates to Nothing (which is the VB equivalent of null), the y-axis maximum will auto-scale.

    -- Robert



  • ReportViewer - Programmatically Customize Chart Axes at Runtime