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. Image for the cookie policy date
close icon

Exporting Chart - include series names as column headers

In the Excel export of a chart, is there any way to set the column names to be the series names.  See below:



Thanks

Attachment: ResourceAssignment_72e4584a.zip

3 Replies

AV Abirami Varadharajan Syncfusion Team August 21, 2017 06:16 AM UTC

Hi Eric, 
 
Thank you for contacting Syncfusion support. 
 
Yes, we can set the column names as series names. We have prepared sample for the same and shared for your reference which can be downloaded from the following link. 
 
 
Kindly refer and let us know that your requirement is fulfilled. 
 
Regards, 
Abirami. 




EO Eric Outley August 21, 2017 02:36 PM UTC

Ok,

So I having a few issues with the sample.  You have me opening a excel file that doesn't exist.  I'm actually creating the Excel file dynamically in code on the server.  So I tried exporting out the file first using:

                ExcelEngine excelEngine = new ExcelEngine();

                ExcelExport exp = new ExcelExport();

                IApplication application = excelEngine.Excel;

                IWorkbook workbook = application.Workbooks.Create(1);

                workbook = exp.Export(obj, data, "ResourceAssignment.xlsx", ExcelVersion.Excel2013, false, null, null);

               IWorksheet sheet = workbook.Worksheets[0]; 

The workbook comes back as null, but the page is asking me to save the Excel file.  It is exported and the code stops.

How do I get the workbook in to an object, so I can change the headers of the column?


Thanks

Eric




MM Mathu Mohan Vijayakumar Syncfusion Team August 22, 2017 12:59 PM UTC

Hi Eric,  
 
It is a usage level issue. We request you to use the following overloaded method to get the workbook object on exporting Excel from Grid.  
 
//Return the workbook object on exporting the Excel file from Grid 
workbook = exp.Export(obj, data, "output.xlsx", ExcelVersion.Excel2013, false, false, "falt-safron", false); 
 
We have prepared sample to export the data from Grid and add the chart in the returned workbook object. The sample can be downloaded from the following link.  
  
Sample Link: 
 
Kindly refer the sample and let us know that your requirement is fulfilled.  
 
Regards, 
Mathu Mohan V A 


Loader.
Live Chat Icon For mobile
Up arrow icon