This is a migrated thread and some comments may be shown as answers.

DataSource Binding Order of Operations?

1 Answer 87 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Xorcist
Top achievements
Rank 1
Xorcist asked on 04 Mar 2014, 03:23 PM
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.


1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 07 Mar 2014, 02:29 PM
Hello,

With the given code you are modifying the report definition. If the DataSource is not reassigned, the definition remains unchanged. Later on processing of the report there will be loaded only the data set by definition.

For more details check the Report Life Cycle article.

Let us know if you have any further questions.

Regards,
Stef
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Tags
Report Designer (standalone)
Asked by
Xorcist
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or