Hello All, Could somebody can show me a short example how to export a dbgrid to a simple text file (comma separated)? I did not find any. There is already an article explaining how to export from THTMLViewer using eDocEngine. However, it tried to solve a bit more complicated. Exporting a DBGrid to excel without OLE I develop software and about 95% of my work deals with databases. I enjoied the advantages of using Microsoft Excel.
|Published (Last):||19 July 2010|
|PDF File Size:||6.26 Mb|
|ePub File Size:||15.30 Mb|
|Price:||Free* [*Free Regsitration Required]|
I’m afraid I don’t undestand this point.
delphi – Exporting data from a DBGrid to Excel – Stack Overflow
Thanks for the procedure! Do not export the DBGrid, export the dataset stackoverflow. I have the feeling that I’m reinventing the wheel TObject ; var Stream: If you want a fast export of raw data, just export your recordset ADODataset.
If you dont have a recordset, you have to iterate your dataset and write excel accesing cells. That’s why I use a dbGrid Mon, 23 Aug The grid is a kind of “preview” and the user can choose the order in wich the fileds will be exported, by changing the field’s order in the grid.
As the DBGrid might have a different set of fields then the original resultset you need to access these.
Rich Wernin Delphi Developer. Tue, 24 Aug FieldCount – 1 do begin S: Any help will be appreciated. CSV from a text file into a record structure 7. All are very good points Okay I will go have a look at that. There’s hits on a Google search for “delphi export dbgrid excel”.
I will save it for future use. FieldName ; for I: CSV File Access FieldCount – 1 do begin sTemp: It is working by using Tfilestream component procedure TForm2. I suggest you start using these, then if you have specific questions about code parts not working, post them here. TObject ; var Lista: Paul Scot Delphi Developer. Sign up using Email and Password. Sun, 29 Aug So I made it last so that Lista doesn’t leak if it does raise an error.
Sergio Gonzale Delphi Developer. And if We want export an ClientDataset to Excel then what we do?
In order to use the variant array approach, you have to know how many rows you have in the query.