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.
Unfortunately, activation email could not send to your email. Please try again.

Error on export

Thread ID:

Created:

Updated:

Platform:

Replies:

123507 Mar 23,2016 10:41 AM Mar 24,2016 08:57 AM ASP.NET Web Forms 1
loading
Tags: Chart
Artur
Asked On March 23, 2016 10:41 AM

Hi,

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 08:57 AM

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


Regards,
Sanjith.


CONFIRMATION

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.

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.

;