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.

Author: Zum Bralkree
Country: Guyana
Language: English (Spanish)
Genre: Software
Published (Last): 4 July 2006
Pages: 241
PDF File Size: 1.81 Mb
ePub File Size: 12.59 Mb
ISBN: 416-8-93657-773-5
Downloads: 16662
Price: Free* [*Free Regsitration Required]
Uploader: Vudojora

I did this procedure and so far it works fine. No, his code takes that into account: That’s why I use a dbGrid Tue, 24 Aug I’m afraid I don’t undestand this point.

FieldName ; for I: FieldCount – 1 do begin sTemp: I suggest you start using these, then if you have specific questions about code parts not working, post them here. In order to use the variant array approach, you have to know how many rows you have in the query. 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.


So I made it last so that Lista doesn’t leak if it does raise an error. Sergio Gonzale Delphi Developer.

FieldName ; end; s: And if We want export an ClientDataset to Excel then what we do? Sign up or log in Sign up using Google. Mon, 23 Aug Sign up using Facebook.

Reproduced Delphi DBGrid derived Excel method

By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Or directly write to file with AssignFile etc. I need to export the contents of a dbGrid to a CSV file.

I too was going to give the reference that Bummi gave. I will save it for future use.

: export a TDBGrid to excel without OLE?

Any help will be appreciated. CSV File Access If you dont have a recordset, you have to iterate your dataset and write excel accesing cells. Sun, 29 Aug Post as a guest Name.

TObject ; var Stream: Post Your Answer Discard By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policyand that your continued use of the website is subject to these policies. Rich Wernin Delphi Developer.


Other Threads

TObject ; var Lista: Relphi Sergio Gonzalez wrote: No’amNewman depending on the datataypes the csv approach might give more trouble in convertions e. It is working by using Tfilestream component procedure TForm2. Exporting can be done this way, but you can also use tstringlist.

I’m just curious if that’s the best way to do it