0

In our application we are having different grids in a form having individual Export to Excel functionality. DevExpress do not provide the functionality to Export multiple grids into an Excel worksheet. How this can be done in Delphi 2007?

Thanks!

Guillem Vicens
  • 3,936
  • 30
  • 44
Abhishek
  • 174
  • 2
  • 9
  • We had to create our own code to export multilevel grids (at least in our devExpress version it was not possible yet). Basically you would have to move through the `Views` you need to export and use `OLE` or some other alternative (not sure if D2007 has native export to Excel) to export the data to the different pages of your worksheet. – Guillem Vicens Jun 21 '13 at 12:33
  • Search how to export data from Delphi to Excel - there are a lot of libraries, commercial and free, and there are a lot of articles about using Delphi's COM-based TExcelApplcation component – Arioch 'The Jun 22 '13 at 13:48
  • You say you have code to export one grid into Excel. What seems to be the problem, what stops you from running it on multiple grids one-by-one? – Kromster Apr 05 '16 at 13:56

1 Answers1

1

https://stackoverflow.com/search?q=%5Bdelphi%5D+export+excel

You can start with either of those approaches and make your export routines. 1st of all you would have to decide whether you would place your different grids onto different sheets within the workbook, or into different files, or left to right in the same worksheet.

Maybe most lazy approach would be to export them to different worksheets, and after that using Excel's COM server (via Delphi TExcelApplication component) to move those sheets into one main workbook, and then close and delete all the temporary and now empty workbooks. This would be quite non-effective approach, but might appear most easy if you already mastered built-in DevEx exporter.

Otherwise those links above have a lot of references to purchase some exporter or create one.

Community
  • 1
  • 1
Arioch 'The
  • 15,799
  • 35
  • 62