I am currently trialing the Telerik reporting tool.
I have successfully created a cross tab report which is fine as long as I don't set the data source at runtime.
If I set the data source at runtime the report loses its groupings.
I have tried setting the grouping again in code but it makes no difference.
Could someone please tell me what I am doing wrong?
Cheers
Jason
Code
OCMBusinessLogic logic = new OCMBusinessLogic();
IList<AOSMatrix> matrixdata = null;
matrixdata = logic.GetAOSMatrix("11/12", "ba_eng");
MessageBox.Show("Rows " + matrixdata.Count.ToString());
AOSModuleMatrix rpt = null;
rpt = new AOSModuleMatrix();
rpt.ReportParameters["ReportTitle"].Value = "Programme matrix for [programme family]";
Telerik.Reporting.Group grp = new Telerik.Reporting.Group();
grp.Name = "AOS";
grp.Groupings.Add(new Telerik.Reporting.Data.Grouping("=Fields.AOScode"));
rpt.Groups.Add(grp);
rpt.DataSource = matrixdata;
ReportProcessor reportProcessor = new ReportProcessor();
Hashtable deviceinfo = new Hashtable();
deviceinfo["FontEmbedding"] = "Subset";
RenderingResult result = reportProcessor.RenderReport("PDF", rpt, deviceinfo);
FileStream fs = new FileStream("c:\\telerik.pdf", FileMode.Create);
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Flush();
fs.Close();
MessageBox.Show("Generated");
I have successfully created a cross tab report which is fine as long as I don't set the data source at runtime.
If I set the data source at runtime the report loses its groupings.
I have tried setting the grouping again in code but it makes no difference.
Could someone please tell me what I am doing wrong?
Cheers
Jason
Code
OCMBusinessLogic logic = new OCMBusinessLogic();
IList<AOSMatrix> matrixdata = null;
matrixdata = logic.GetAOSMatrix("11/12", "ba_eng");
MessageBox.Show("Rows " + matrixdata.Count.ToString());
AOSModuleMatrix rpt = null;
rpt = new AOSModuleMatrix();
rpt.ReportParameters["ReportTitle"].Value = "Programme matrix for [programme family]";
Telerik.Reporting.Group grp = new Telerik.Reporting.Group();
grp.Name = "AOS";
grp.Groupings.Add(new Telerik.Reporting.Data.Grouping("=Fields.AOScode"));
rpt.Groups.Add(grp);
rpt.DataSource = matrixdata;
ReportProcessor reportProcessor = new ReportProcessor();
Hashtable deviceinfo = new Hashtable();
deviceinfo["FontEmbedding"] = "Subset";
RenderingResult result = reportProcessor.RenderReport("PDF", rpt, deviceinfo);
FileStream fs = new FileStream("c:\\telerik.pdf", FileMode.Create);
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Flush();
fs.Close();
MessageBox.Show("Generated");