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

Report and PDF showing different chart while using DataGroupColumn?

1 Answer 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 29 Oct 2008, 09:10 AM

Hello,

on my report i have a simple chart1. This chart1 has a datagroupcolumn and uses the NeedDataSource event. The chart is shown perfectly in the report.
However when exporting to PDF/TIFF/ HTML it shows a different chart!

Simple example:

In the chart1.designer.cs code i add 2 lines:

this.chart1.DataGroupColumn = "Name";   
this.chart1.NeedDataSource += new System.EventHandler(this.chart1_NeedDataSource);


In the chart1.cs code i have add the following needdatasource:

private void chart1_NeedDataSource(object sender, System.EventArgs e)
       
   Telerik.Reporting.Processing.Chart chart = sender as Telerik.Reporting.Processing.Chart;
   DataTable tbl = new DataTable();
   DataColumn col = new DataColumn("Val");
   col.DataType = typeof(int);
   tbl.Columns.Add(col);
   col = new DataColumn("Val2");
   col.DataType = typeof(int);
   tbl.Columns.Add(col);
   col = new DataColumn("Name");
   col.DataType = typeof(string);
   tbl.Columns.Add(col);
   tbl.Rows.Add(new object[] { 11, 3, "a" });
   tbl.Rows.Add(new object[] { 11, 4, "a" });
   tbl.Rows.Add(new object[] { 11, 5, "b" });
   tbl.Rows.Add(new object[] { 11, 6, "b" });
   tbl.Rows.Add(new object[] { 11, 7, "c" });
   tbl.Rows.Add(new object[] { 11, 8, "c" });
   chart.DataSource = tbl;
        }

When exporting this to PDF is seems like if the first bar of the datagroup is correct, but the other bars are just copies of this first bar, even though they have different values. There seems something wrong with rendering to PDF when you are using the DataGroupColumn. This seems like a bug.
When i just remove the DataGroupColumn, it obviously shows me a completely different chart, but that one is exported in the right way.  We are using Telerik Reporting 2008 Q1. I've read some release notes of future versions but cannot find anything related to this. Any suggestions?

John Neus


 





 

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 29 Oct 2008, 10:49 AM
Hello John,

I've used your code on my end with the latest official Q2 SP2 release and could not reproduce the problem you describe. Find attached the exported pdf file and let me know what differs in your case.

Sincerely yours,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or