SfDataGrid export to Excel
- The GridStackHeadersDescriptors of the SfDataGrid do not appear in the excel Worksheet
- The excel Worksheet contains also the hidden columns
- The excel Worksheet does not contain any style (background color, foreground color, etc) at all.
What we want is the exported worksheet and the SfDataGrid to have the same appearance. Is there anything you can do to help us?
We are looking forward your reply ASAP.
Thank you.
Hi Constantin,
Thank you for contacting Syncfusion Support.
We have analyzed your query and please find the solution for your queries from the below table :
|
S.No |
Query |
Comments |
|
1. |
GridStackHeadersDescriptors of the SfDataGrid do not appear in the excel Worksheet |
You can achieve this by setting ExcelExportingOptions.ExportStackedHeaders to True. |
|
2. |
Excel Worksheet contains also the hidden columns |
We have analyzed your query and you can achieve your requirement by using ExcelExportingOptions.ExcludeColumns property. |
|
3. |
Excel Worksheet does not contain any style (background color, foreground color, etc) at all. |
We regret to inform you that this is default behavior of SfDataGrid. But, you can set the style to Excel sheet in Exporting time by handling CellExportingHandler and ExportingEventHandler. |
We have prepared a sample based on your all requirement and attached in the below sample link for your reference:
Sample link: http://www.syncfusion.com/downloads/support/directtrac/118396/ExportToExcel-894322957.zip
Please let us know if you require further assistance.
Thanks,
Ashok
First of all I would like to thank you very much for your prompt reply.
We tried to run the sample code that you have sent us, but we cannot build it because we have the following error:
"'Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions' does not contain a definition for 'ExportStackedHeaders' and no extension method 'ExportStackedHeaders' accepting a first argument of type 'Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions' could be found (are you missing a using directive or an assembly reference?)"
Note that we are using the 12.1451.0.43 Syncfusion version. Could this be the problem? If yes, what can we do about this? If not, is there anything else we could try?
We're waiting for your reply.
Thanks in advance.
Hi Constantin,
We are sorry about the inconvenience caused.
We have analyzed your query and we have provided support for ExcelExportingOptions.ExportStackedHeaders in 12.2 version. So, we request you to upgrade your product version to our current version in order to get the fix for this issue.
Please let us know if you require further assistance.
Thanks,
Ashok
Attachment: GridExportTestUtility_93a395c1.zip
Yes, the reported issue has been fixed and included in our 2018 Volume 2 SP1 (16.2.0.46) release and is available for download under the following link.
https://www.syncfusion.com/forums/138986/essential-studio-2018-volume-2-service-pack-release-v16-2-0-46-available-for-download
We are glad to announce that our Essential Studio Volume 2 SP2 2018 (v16.2.0.50) also rolled out and is available for download under the following link. This latest version has the fix for your reported issue.
https://www.syncfusion.com/forums/139512/essential-studio-2018-volume-2-service-pack-release-v16-2-0-50-available-for-download
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Deivaselvan
We have provided separate NuGet packages for each .NET Framework version assembly till v16.1.0.24. We suspect that you may using the old package name and so it shows the 16.1.0.24 release as a latest stable package instead of 16.2.0.50. From Essential Studio 2018 Volume 1 SP 1 release (v16.1.0.32) onwards each NuGet package will contain all applicable .NET Framework versions for the Syncfusion component.
Example NuGet package structure changes have been shown below
|
Component Name |
Till v16.1.0.24 |
From v16.1.0.32 |
|
Grid WPF |
Syncfusion.SfGrid.WPF40
Syncfusion.SfGrid.WPF45
Syncfusion.SfGrid.WPF451
Syncfusion.SfGrid.WPF46 |
Syncfusion.SfGrid.WPF |
Please refer the below article more details on this changes and let us know if this helps you.
https://www.syncfusion.com/kb/8614/syncfusion-nuget-package-structure-changes
We have introduced a new licensing system starting with version 16.2.0.x release of Essential Studio. These changes apply to all evaluators and only to paid customers who use NuGet packages. Starting with v16.2.0.x, if you reference Syncfusion assemblies from evaluation builds or from the NuGet feed, you also must include a license key in your projects.
Refer the below documentation to get license key and code example on how it can be registered in your WPF application.
https://help.syncfusion.com/common/essential-studio/licensing/license-key
https://help.syncfusion.com/common/essential-studio/licensing/license-key#wpf
Please let us know if you have any other questions.
Regards,
Deivaselvan
Attachment: GridExportTestUtility_7f94fb9f.zip
We can reproduce the reported issue with the given sample and our developer has confirmed it as a defect. We have logged a defect report for this and this fix will be available in Volume 3 Service Pack 1 Release 2018.
Regards,
Shobika
- 13 Replies
- 6 Participants
-
CP Constantin Patak
- Mar 4, 2015 08:19 PM UTC
- Sep 25, 2018 02:53 AM UTC