We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error on export

Thread ID:





123507 Mar 23,2016 02:41 PM UTC Mar 24,2016 12:57 PM UTC ASP.NET Web Forms 1
Tags: Chart
Asked On March 23, 2016 02:41 PM UTC


I am trying to export charts to excel using code similar to the following :

ExcelExport exp = new ExcelExport();
exp.Export(this.Chart1.Model, (IEnumerable)Chart1.DataSource, "Export.xlsx", ExcelVersion.Excel2010, null, null);

But, In my code, the first parameter of the Export function is of the type Syncfusion.Javascript.DataVisualization.Models.GridProperties, and 
the Chart.Model attribute is of the type Syncfusion.Javascript.DataVisualization.Models.ChartProperties. So, in runtime, it throws a InvalidCastException.

Sanjith Kesavan [Syncfusion]
Replied On March 24, 2016 12:57 PM UTC

Hi Artur,

Thanks for contacting Syncfusion support. We have analyzed your query and code example. For exporting the chart into excel format, in export function you have to give chart parameters only. Using the export method of the chart, we cannot export the grid into excel format and so it shows the exception. If we pass the chart parameters the export function, export to excel is working fine without showing any exception. Please follow the below screenshot

Could you please provide us the following information.

1.       Why did you use grid parameters in the export method instead of chart parameters

2.       Do you want to export the grid into excel format
This information will be helpful for us to proceed further.

In the below link, we have attached sample for your reference.
Sample link: http://www.syncfusion.com/downloads/support/forum/123507/ze/Excel_export1879906251



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon