XtraGrid - Export To Excel

若如初见. 提交于 2019-12-08 04:33:28
Davide Piras

I would use the built-in method from XtraGrid to export to excel as you say it's even faster.

After having generated the two excel files I would use Excel Interop assemblies only to merge the two resulting files in the same file on two separated Excel Sheets in same workbook.

so your problem would not be with XtraGrid anymore but simply with how to merge two files into one in separated worksheets, discussed many times already and you will find solutions online, for example here: How do I merge 2 Excel files into one excel file with separated sheets?

Jay

I know this is a late answer but, you can use devExpress methods and components to export multiple grids to the same excel file. (Perhaps this was not the case in older versions, I am not sure when it became available)

Add a printableComponentLink to each gridControl, and then Create a compositeLink that you can add each of the printableComponent links to.

Then you will use the compositeLink.ExportToXlsx method. If you create XlsxExportOptions with the XlsxExportOptions.ExportMode property equal to SingleFilePageByPage and pass it to the CompositeLink.ExportToXlsx method, every page will be exported to a separate sheet.

This post brought this question to my attention.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!