two sub report in report
Posted: Mon Oct 08, 2012 8:00 am
Hello,
I trying to use two sub reports in my report, one in header and the other in footer, both header and footer in two external reports, but when i try to run the report it generated the following exception in this line report.Render(), the error message is ( An unhandled exception of type 'System.StackOverflowException' occurred in Stimulsoft.Base.dll )
the following is my code :
i am using stimulsoft.report.web 2012.2
thank you
I trying to use two sub reports in my report, one in header and the other in footer, both header and footer in two external reports, but when i try to run the report it generated the following exception in this line report.Render(), the error message is ( An unhandled exception of type 'System.StackOverflowException' occurred in Stimulsoft.Base.dll )
the following is my code :
Code: Select all
StiReport report = new StiReport();
.
.
report.GetSubReport += new StiGetSubReportEventHandler(rep_GetSubReport);
report.GetSubReport += new StiGetSubReportEventHandler(rep_GetFooterReport);
report.Compile();
report.Render();
StiWebViewerFx1.Report = report;
void rep_GetSubReport(object sender, StiGetSubReportEventArgs e)
{
StiReport rep = new StiReport();
dt = (DataTable)hc.FetchData("Select * From Report where RepNameEn = 'Header' ");
string a = ""; //save the report string
if (hc.IsValidDT(dt))
{
DataRow[] rows = dt.Select("RepNameEn = 'Header'");
DataRow dr = rows[0];
a = dr["RepStringEdited"].ToString();
}
rep.LoadFromString(a);
e.Report = rep;
}
void rep_GetFooterReport(object sender, StiGetSubReportEventArgs e)
{
StiReport rep = new StiReport();
dt = (DataTable)hc.FetchData("Select * From Report where RepNameEn = 'Footer' ");
string a = ""; //save the report string
if (hc.IsValidDT(dt))
{
DataRow[] rows = dt.Select("RepNameEn = 'Footer'");
DataRow dr = rows[0];
a = dr["RepStringEdited"].ToString();
}
rep.LoadFromString(a);
e.Report = rep;
}
thank you