0

I'm trying to export a RadGrid to pdf (or excel). My RadGrid contains RadHtmlGridCharts also. I want to export them with the RadGrid in any format (image, charts, or whatever) but all I get is a table with text but not the charts.

Here is ASPX code:

<telerik:RadGrid ID="RadGrid5" runat="server" AllowPaging="false" 
                 Skin="Default" OnItemDataBound="RadGrid5_ItemDataBound"
                 OnNeedDataSource="RadGrid5_NeedDataSource" OnItemCreated="RadGrid5_ItemCreated"
                 OnItemCommand="RadGrid5_ItemCommand">

Code behind:

protected void RadGrid5_ItemCreated(object sender, GridItemEventArgs e)
{
    e.Item.Visible = true;
}
public void ConfigureExport(RadGrid sender)
{
    sender.ExportSettings.OpenInNewWindow = true;
    sender.ExportSettings.FileName = "ExportedData";
}
protected void RadButton_Click(object sender, EventArgs e)
{
    ConfigureExport(RadGrid5);
    RadGrid5.MasterTableView.ExportToExcel();
}
DanM7
  • 2,203
  • 3
  • 28
  • 46
AKO
  • 131
  • 1
  • 11

1 Answers1

0

RadHtmlChart renders with JavaScript on the client so you won't be able to include it in a server export. Perhaps you can take a screenshot of the rendered page and put it in a PDF or PNG with a tool like PhantomJS but otherwise - you may need to use the old RadChart that renders an image. Maybe this will help http://www.telerik.com/support/code-library/convert-grid-and-chart-with-custum-lines-inside-a-grid-to-pdf or this one http://www.telerik.com/support/code-library/exporting-radchart-to-pdf

rdmptn
  • 5,413
  • 1
  • 16
  • 29
  • well actually I figure out it couldn't be exported without third party.. so I changed them to the old RadChart just exactly as you suggested, thanks :) – AKO Jun 26 '14 at 07:55