简体   繁体   English

将网格导出到excel + OOXML

[英]Exporting grid to excel + OOXML

Earlier we used BIFF to export the grid to excel but there is a limitation of rows so that we thought of moving to OOXML format. 之前我们使用BIFF将网格导出到excel,但是行数有限,因此我们考虑转向OOXML格式。 Is there any sample source available to get started. 是否有任何示例资源可用于入门。 Please help me with this as i am new to Delphi. 请帮助我,因为我是Delphi的新手。

Firstly I would just use the built in DevExpress export to Excel facility. 首先,我只是使用内置的DevExpress导出到Excel工具。 It will save you days of work: 这将节省您的工作的日子

cxGridExportLink.pas : ExportGridToExcel [doesn't use OOXML] or ExportGridToXLSX [does use OOXML via custom DX xml document class amongst other things] cxGridExportLink.pas:ExportGridToExcel [不使用OOXML]或ExportGridToXLSX [通过自定义DX xml文档类使用OOXML]

However, if you must use a DIY OpenXML approach then the best places to start are: 但是,如果必须使用DIY OpenXML方法,那么最好的起点是:

These are all C# references but it's not too difficult to translate, mainly because it's the XML you're after anyway. 这些都是C#引用,但翻译起来并不难,主要是因为无论如何它都是您要使用的XML。 I did some work reading and writing to Word and Excel using the OpenXML stuff and the only way to learn it was by opening up an existing document using the OpenXML viewer and trawling through the sheets / rows / cells trying to work out how it all fits together. 我做了一些使用OpenXML东西读写Word和Excel的工作,而学习它的唯一方法是使用OpenXML查看器打开一个现有文档,并在工作表/行/单元格中拖拉,试图找出所有合适的方式一起。 It's not easy and the docs are hard work and limited. 这并不容易,文档工作辛苦且有限。 It's sort of satisfying when you start to work it out but it sure is time consuming. 当您开始解决问题时,这会让人感到满意,但确实很耗时。

EDIT 编辑

Just realised that the DX stuff I have is TcxGrid - ie not the earlier TdxDBGrid. 刚意识到我拥有的DX东西是TcxGrid-即不是早期的TdxDBGrid。 Not sure if that will make a difference in this scenario. 不确定在这种情况下是否会有所作为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM