none
Report Viewer didn't call sub Report method RRS feed

  • Question

  • I use following code to generate a PDF report:

    public partial class Report{   
     public void myMethode(DataTable DT){
    
            ReportViewer reportViewer1 = new ReportViewer();
            reportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(new PermissionSet(PermissionState.Unrestricted));
            reportViewer1.LocalReport.ReportPath = @"Something" + ReportName + ".rdlc";
            reportViewer1.ProcessingMode = ProcessingMode.Local;
    
            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", DT));
            reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubReportProcessing);
    
            Warning[] warnings;
            string[] streamIds;
            string mimeType = string.Empty;
            string encoding = string.Empty;
            string extension = string.Empty;
            reportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
    
       }
     private static void SubReportProcessing(object sender, Microsoft.Reporting.WebForms.SubreportProcessingEventArgs e)
       {
            //do something
       }
    
    }

    It's work fine for every main report but when it want to generate subreport it didn't call SubReportProcessing method!!!

    So can some one help me to find problem??

    I am using Dot Net 4.7.2 also I used this as web api and I use Microsoft.ReportViewer.WebFormsversion 12.0.0.0

    Sunday, May 26, 2019 10:42 AM

All replies

  • Hi amir133,

    Thank you for posting here.

    Since this thread is related to Microsoft.ReportViewer.WebForms, I find it is a webform control. Therefore, I suggest that you could post in the following forum.

    https://forums.asp.net/18.aspx/1?Web+Forms

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 27, 2019 7:17 AM
  • thanks...
    Monday, May 27, 2019 12:42 PM