
Is there any way to know when the data processing gets complete? In other words, I would like to know when the report has completed binding its data.
Thanks
3 Answers, 1 is accepted
The Report Life Cycle and Understanding Events help articles cover this matter. Please review them and let us know if further help is needed.
Sincerely yours,
Steve
the Telerik team

Thank you for getting back.
I should have included more description of what I'm trying to do.
I have a report container with numerous sub-reports in it. I want to run the report and then save as a pdf.
My code is something like:
..
Logger.Write("PersistReportToFile starting", Trace);
Telerik.Reporting.
IReportDocument currentReport = reportViewer1.Report;
if (currentReport == null)
{
Logger.Write("nulll!", Error);
}
// Set current report parameters to parameters supplied on the command line
List<Telerik.Reporting.ReportParameter> rp = currentReport.ReportParameters.ToList<Telerik.Reporting.ReportParameter>();
rp[0].Value = (
DateTime) e.Data.Parameters["StartDate"];
rp[1].Value = (
DateTime)e.Data.Parameters["EndDate"];
reportViewer1.RefreshReport();
SaveReport( currentReport, (
string)e.Data.Parameters["FileName"]);
=================================================
The issue is that many times the resultant PDF just contains the labels preceding each sub-report. It's like none of the sub-reports executed.
But, if I add a sleep to the above code, it works.
....
reportViewer1.RefreshReport();
Thread.Sleep(60*1000);
SaveReport( currentReport, (string)e.Data.Parameters["FileName"]);
...
So, it would appear that I need to wait a little longer before calling savereport.???
Any ideas? in addition, we've verified all report parameters are being set correctly.
savereport is as follows:
public void SaveReport(Telerik.Reporting.IReportDocument report, string absoluteFileName)
{
ReportProcessor reportProcessor = new ReportProcessor();
RenderingResult result = null;
Logger.Write("reportProcessor.RenderReport", Trace);
try
{
result = reportProcessor.RenderReport(
"PDF", report, null);
}
catch(Exception ex )
{
Logger.Write("reportProcessor.RenderReport:" + ex.ToString(), Error);
}
if (result != null)
{
using (FileStream fs = new FileStream(absoluteFileName, FileMode.Create))
{
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Close();
}
}
}
// end of SaveReport()
Thanks,
Michael
Thank you for the thorough description. However we were not able to reproduce such problem and the very fact it works with a sleep is most interesting. Please open a support ticket and attach a sample runnable report showing the problem, so we can review it locally and advise you.
P.S. Is there any specific reason to use SubReports for this scenario. We believe that the Report Book functionality would work better for such case.
Sincerely yours,
Steve
the Telerik team