Hello forum,
we have three RadHtmlCharts on one page and we would like to export them to excel, all at once.
So our plan is to make a new RadGrid in code-behind, add those three charts to this grid and export that grid.
So i wrote this piece of Code:
The download starts as wanted but the in the grid are only the titles with "Telerik.Web.UI.RadHtmlChart" under it.
Why are the Chart not shown?
What am i doing wrong?
we have three RadHtmlCharts on one page and we would like to export them to excel, all at once.
So our plan is to make a new RadGrid in code-behind, add those three charts to this grid and export that grid.
So i wrote this piece of Code:
private void ExportChartsToExcel() { RadGrid chartWrapperGrid = new RadGrid(); chartWrapperGrid.ID = "ChartWrapperGrid"; chartWrapperGrid.AutoGenerateColumns = false; GridBoundColumn boundColumn1 = new GridBoundColumn(); boundColumn1.DataField = "Chart1"; boundColumn1.HeaderText = "Chart 1"; chartWrapperGrid.MasterTableView.Columns.Add(boundColumn1); GridBoundColumn boundColumn2 = new GridBoundColumn(); boundColumn2.DataField = "Chart2"; boundColumn2.HeaderText = "Chart 2"; chartWrapperGrid.MasterTableView.Columns.Add(boundColumn2); GridBoundColumn boundColumn3 = new GridBoundColumn(); boundColumn3.DataField = "Chart3"; boundColumn3.HeaderText = "Chart 3"; chartWrapperGrid.MasterTableView.Columns.Add(boundColumn3); DataTable chartTable = new DataTable(); chartTable.Columns.Add("Chart1"); chartTable.Columns.Add("Chart2"); chartTable.Columns.Add("Chart3"); RadHtmlChart[] chartArray = new RadHtmlChart[] { Chart1, Chart2, Chart3 }; chartTable.Rows.Add(chartArray); chartWrapperGrid.DataSource = chartTable; this.form1.Controls.Add(chartWrapperGrid); chartWrapperGrid.ExportSettings.OpenInNewWindow = true; chartWrapperGrid.ExportSettings.ExportOnlyData = true; chartWrapperGrid.ExportSettings.IgnorePaging = true; chartWrapperGrid.MasterTableView.ExportToExcel();}The download starts as wanted but the in the grid are only the titles with "Telerik.Web.UI.RadHtmlChart" under it.
Why are the Chart not shown?
What am i doing wrong?