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

Dynamic Reports in Q2 2012

0 Answers 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jako
Top achievements
Rank 1
Jako asked on 19 Jun 2012, 12:06 PM
Hi

I have created my project using the Q1 Trial API's, but now that I have bought the Q2 2012 license, some of the code is not working.

EDIT: I have got it working, two things, you need to switch to the Telerik ReportXMLSerializer and use a IgnoreWhitespace setting in the XMLReader.

Example, before in Q1 2012:
string reportPath = Server.MapPath("./reports") + @"\reportClients.trdx";
using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(reportPath))
{
    System.Xml.Serialization.XmlSerializer xmlSerializer = new System.Xml.Serialization.XmlSerializer(typeof(Telerik.Reporting.Report));
  
    Telerik.Reporting.Report clientReport = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
    Report report = new Report();
  
    clientReport.DataSource = report.GetClientReportData(businessTypeID, siteID);
    uxClientReport.Report = clientReport;
    uxClientReport.RefreshReport();
}
using the Telerik ReportXMLSerializer in Q2
System.Xml.XmlReaderSettings settings = new System.Xml.XmlReaderSettings();
settings.IgnoreWhitespace = true;
using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(reportPath, settings))
{
    Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
 
    Telerik.Reporting.Report clientReport = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
    Report report = new Report();
     
    clientReport.DataSource = report.GetClientReportData(businessTypeID, siteID);
 
    uxClientReport.ReportSource = clientReport;
    uxClientReport.RefreshReport();
}

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Jako
Top achievements
Rank 1
Share this question
or