I'm exporting a report programmatically to PDF using code like this:
var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
var deviceInfo = new System.Collections.Hashtable();
var reportSource = new Telerik.Reporting.UriReportSource();
reportSource.Uri = "<My report path>.trdp";
//Various parameters are set
object ParmValue;
ParmValue = "<My value>";
reportSource.Parameters.Add("<My parameter name>", ParmValue);
Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", reportSource, deviceInfo);
After this I save the result into SQL server for retrieval later. For these reports I always get a result object back even if there are no data rows returned from the database query the report makes (it still has headers/footers/etc. but no details). What I'd like to do is determine if there weren't any data rows returned and take alternate action myself.
Is there a way to determine how many data rows were retrieved by the report? The only solution I can come up with at the moment is querying the database twice; first without the report being involved to see if the database query will returns any rows; and then again by the RenderReport method if there's data to report on. That isn't efficient though. Is there something in the report objects that will tell me if there was no data returned to the report?