Hi telerik team:
I've just updated to new telerik report libraries and I've discovered that ReportSource property doesn't exist and I don't know how to bind the report as old way. This is the code:
private void RunReport(DataTable dt)
{
Report report;
XmlReaderSettings settings;
XmlReader xmlReader;
ReportXmlSerializer xmlSerializer;
settings = new XmlReaderSettings();
settings.IgnoreWhitespace = true;
using (xmlReader = XmlReader.Create(Server.MapPath(@"SupervisoryExceptions.trdx"), settings))
{
xmlSerializer = new ReportXmlSerializer();
report = (Report)xmlSerializer.Deserialize(xmlReader);
}
report.ReportParameters["pDatabase"].Value = "Test Searching";
report.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Letter;
report.DataSource = dt;
// Use the InstanceReportSource to pass the report to the viewer for displaying
Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = report;
//This is the line that doesn't compile
reportViewer1.ReportSource = reportSource;
}
I've just updated to new telerik report libraries and I've discovered that ReportSource property doesn't exist and I don't know how to bind the report as old way. This is the code:
private void RunReport(DataTable dt)
{
Report report;
XmlReaderSettings settings;
XmlReader xmlReader;
ReportXmlSerializer xmlSerializer;
settings = new XmlReaderSettings();
settings.IgnoreWhitespace = true;
using (xmlReader = XmlReader.Create(Server.MapPath(@"SupervisoryExceptions.trdx"), settings))
{
xmlSerializer = new ReportXmlSerializer();
report = (Report)xmlSerializer.Deserialize(xmlReader);
}
report.ReportParameters["pDatabase"].Value = "Test Searching";
report.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Letter;
report.DataSource = dt;
// Use the InstanceReportSource to pass the report to the viewer for displaying
Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = report;
//This is the line that doesn't compile
reportViewer1.ReportSource = reportSource;
}