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):||3 June 2009|
|PDF File Size:||19.48 Mb|
|ePub File Size:||11.33 Mb|
|Price:||Free* [*Free Regsitration Required]|
Export contents of DBGrid to Excel or ClipBoard
Sign up using Facebook. And if We want export an ClientDataset to Excel then what we do?
Alexander 3, 6 13 The downside of your approach is that its not reusable, IMO a better route is to have a procedure you can use to handle it. CSV from a text file into a record structure 7. TObject ; var Stream: The ‘try’ is in the wrong place, though. Do not export the DBGrid, export the dataset stackoverflow. Sign up using Email and Password. FieldName ; end; s: I have the feeling that I’m reinventing the wheel No’amNewman depending on the datataypes the csv approach might give more trouble in convertions e.
Sign up or log in Sign up using Google.
How to export data in DBGrid to excel – Delphi Pages Forums
Exporting can be done delpji way, but you can also use tstringlist. And bummi’s right; if at all possible export the underlying dataset.
In order to use the variant array approach, you have to know how many rows you have in the query. Rich Wernin Delphi Developer.
Reproduced Delphi DBGrid derived Excel method
It is working by using Tfilestream component procedure TForm2. Post as a guest Name. As the DBGrid might have a different set of fields then the original resultset you need to access these.
No, his code takes that into account: Otherwise it may be simpler to use the csv approach which I gave in that question. Or directly write to file with AssignFile etc. Any help will be appreciated. Sergio Gonzale Delphi Developer.