I'm working on a proof of concept using Telerik Reporting. The requirements are that the report be loaded from an XML source and provide that report with data via a DataTable (from the System.Data namespace). The problem is that my data isn't showing up in my report. The generated report has table in it and it has the right number of rows but there is no information in any of the rows. Below is a copy of the code I'm using to generate the report:
XmlReaderSettings settings =
new
XmlReaderSettings
{
IgnoreWhitespace =
true
};
using
(StringReader sr =
new
StringReader(template.Layout))
//template.Layout contains a string which is the report XML
using
(XmlReader xmlReader = XmlReader.Create(sr, settings))
{
ReportXmlSerializer xmlSerializer =
new
ReportXmlSerializer();
TelerikReport reportInstance = (TelerikReport)xmlSerializer.Deserialize(xmlReader);
DataSet data = BuildDataSet(template, parameters);
//Retreives the data from the database in a DataSet
ObjectDataSource dataSource =
new
ObjectDataSource
{
DataSource = data.Tables[0]
};
reportInstance.DataSource = dataSource;
return
reportInstance;
}
The XML for the report (and the value of template.Layout) can be found here. The generated PDF shows 3 rows which is the same number of rows that the DataTable has. That means the DataTable is being read correctly but the data isn't getting parsed correctly for some reason. If I can get this working it would make Telerik the prime candidate for the final version of the software.