I am using telerik Silevrlight Reportviewer. I am able to see pie chart with values in Report Viewer but when i try to Export to PDF , instead of pie chart I am getting "There is no empty series". Any help is highly appreciated.
Regards,
Shweta
4 Answers, 1 is accepted
How do you create the chart item and its series? You can either bind the chart declaratively with the help of our Data Source Components or use its NeedDataSource event to manually create the series and items. If you're adding them in any other event then verify that your code is executed for a second time as the report is recreated prior exporting.
Greetings,
Steve
the Telerik team
Thanks for reply. This is how I am binidng the chart items under needdatasource event.
private void chart1_NeedDataSource(object sender, EventArgs e)
{
Telerik.Reporting.Processing.
ReportItemBase itemBase = sender as Telerik.Reporting.Processing.ReportItemBase;
Telerik.Reporting.Processing.
Chart chart = sender as Telerik.Reporting.Processing.Chart;
string serviceTypeId = (string)itemBase.DataObject["ServiceTypeId"];
string inputXml = (string)this.ReportParameters["InputXMLParameter"].Value;
ChartSeries series = new ChartSeries();
series.Appearance.LegendDisplayMode = Telerik.Reporting.Charting.
ChartSeriesLegendDisplayMode.ItemLabels;
series.DataLabelsColumn =
"Status";
series.DataYColumn =
"DurationforChart";
series.Name =
"Series 1";
series.Type = Telerik.Reporting.Charting.
ChartSeriesType.Pie;
chart2.Series.Clear();
this.chart2.Series.Add(series);
chart.DataSource = statusSummaryByFacility.GetStatusDataByRegionFacillityAndServiceType(inputXml, viewId, facilityId, serviceTypeId);
}
Is there anything worng I am doing.
REgards,
Shweta
I do not see anything wrong with the code you have posted and suspect that the problem is related to the GetStatusDataByRegionFacillityAndServiceType method. Most probably the four parameters it accepts do not contain data upon export i.e. where are viewId and facilityId coming from. Please debug your code and make sure that the method you set as data source for the chart, returns data.
Regards,
Steve
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
I'm in the same problem. When I try to export to i.e. PDF my report parameters are null.
At first time, i catch the report parameters in the myReport_NeedDataSource event like this and go all OK:
Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;
<
br
> param1 = report.Parameters["paramString1"].Value.ToString();
<
br
> param2 = report.Parameters["paramString2"].Value.ToString();
but when I try to export I don't known how to get again the report parameters.
thanks for all.
I Fixed my problem, with a method that catch my Report as parameter and I call when myChart_NeedDataSource event fires.