A
amir133
Guest
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
Continue reading...
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
Continue reading...