Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Follow this code : >> </p> <pre><code>string path = HttpContext.Current.Server.MapPath(Your Report path); ReportViewer1.Reset(); //important ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; // Add sub report even handler if you need ***ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(MySubreportProcessingEventHandler);*** LocalReport objReport = ReportViewer1.LocalReport; objReport.ReportPath = path; // Add Parameter If you need List&lt;ReportParameter&gt; parameters = new List&lt;ReportParameter&gt;(); parameters.Add(new ReportParameter("Name", Value)); ReportViewer1.LocalReport.SetParameters(parameters); ReportViewer1.ShowParameterPrompts = false; ReportViewer1.ShowPromptAreaButton = false; ReportViewer1.LocalReport.Refresh(); //Add Datasourdce ReportDataSource reportDataSource = new ReportDataSource(); reportDataSource.Name = "Datasource Name Used due to report design"; reportDataSource.Value = DataSourceValue(Your object data-source); objReport.DataSources.Add(reportDataSource); objReport.Refresh(); </code></pre> <p>Here Subreport Even handler code</p> <pre><code>private void MySubreportProcessingEventHandler(object sender, SubreportProcessingEventArgs e) { //You can get parameter from main report int paramname = int.Parse(e.Parameters[0].Values[0].ToString()); //You can also add parameter in sub report if you need like main report //Now add sub report data source e.DataSources.Add(new ReportDataSource("DataSource Name",DataSourceValue))); } </code></pre> <p>If you need to create Drillthrough report than follow this link <a href="https://stackoverflow.com/questions/10106376/calling-drillthrough-report-in-rdlc/10210131#10210131">Click here for Drillthrough report</a> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload