简体   繁体   中英

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. Is there any sample source available to get started. Please help me with this as i am new to Delphi.

Firstly I would just use the built in DevExpress export to Excel facility. 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]

However, if you must use a DIY OpenXML approach then the best places to start are:

These are all C# references but it's not too difficult to translate, mainly because it's the XML you're after anyway. 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. 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. Not sure if that will make a difference in this scenario.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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