So we have used the standalone designer to create a report, we are using an ObjectDataSource (and access method of that object to return data). This works completely fine, and we are able to preview our test data while designing the report.
In our web application we deserialize the report file (*.trdx) in order to change the report DataSource and use real data like this:
XmlReaderSettings settings = new XmlReaderSettings() { IgnoreWhitespace = true };
Telerik.Reporting.Report rpt;
String file = Server.MapPath("~/Reports/OurReport.trdx");
using (XmlReader xmlReader = XmlReader.Create(file, settings)) {
ReportXmlSerializer xmlSerializer = new ReportXmlSerializer();
rpt = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
}
InstanceReportSource ReportSource = new InstanceReportSource();
ReportSource.ReportDocument = rpt;
ReportSource.ReportDocument.Reports.FirstOrDefault().DataSource = GetData();
What I am unclear about, is whether or not the report goes through the process of loading up all our test data first, before we acquire the real data (i.e. GetData()) and assign it to the DataSource. If we comment out the DataSource assignment we'll see the test data displayed in the report viewer, which makes me wonder. I definitely don't want the report to go through the trouble of generating data that is just going to be overwritten. Can someone clue me in on the order of operations in regards to this, so we can avoid any unnecessary overhead.
In our web application we deserialize the report file (*.trdx) in order to change the report DataSource and use real data like this:
XmlReaderSettings settings = new XmlReaderSettings() { IgnoreWhitespace = true };
Telerik.Reporting.Report rpt;
String file = Server.MapPath("~/Reports/OurReport.trdx");
using (XmlReader xmlReader = XmlReader.Create(file, settings)) {
ReportXmlSerializer xmlSerializer = new ReportXmlSerializer();
rpt = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
}
InstanceReportSource ReportSource = new InstanceReportSource();
ReportSource.ReportDocument = rpt;
ReportSource.ReportDocument.Reports.FirstOrDefault().DataSource = GetData();
What I am unclear about, is whether or not the report goes through the process of loading up all our test data first, before we acquire the real data (i.e. GetData()) and assign it to the DataSource. If we comment out the DataSource assignment we'll see the test data displayed in the report viewer, which makes me wonder. I definitely don't want the report to go through the trouble of generating data that is just going to be overwritten. Can someone clue me in on the order of operations in regards to this, so we can avoid any unnecessary overhead.