History

DELPHI DBGRID EXPORT TO PDF

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: Fauzshura Arasida
Country: Lebanon
Language: English (Spanish)
Genre: Life
Published (Last): 19 June 2018
Pages: 414
PDF File Size: 15.14 Mb
ePub File Size: 17.96 Mb
ISBN: 544-8-93248-706-6
Downloads: 12524
Price: Free* [*Free Regsitration Required]
Uploader: Shakaktilar

I would write a generic procedure taking the dbgrid as a parameter and then follow the properties to retrieve header and data.

: export a TDBGrid to excel without OLE?

FieldCount – 1 do begin sTemp: FieldName ; end; s: FieldCount – 1 exporr begin S: Mon, 23 Aug No, his code takes that into account: Do not export the DBGrid, export the dataset stackoverflow. 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.

It is working by using Tfilestream component procedure TForm2. Any help will be appreciated.

  BOTHROPS JARARACUSSU PDF

By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

FieldCount – 1 do begin s: Okay I will go have a look at that. As the DBGrid might have a different set of fields then the original resultset you need to access these. TObject ; var Lista: I too was going to give the reference that Bummi gave. The ‘try’ is in the wrong place, though.

I need to export the contents of a dbGrid to a CSV file. If you dont have a recordset, you have to iterate your dataset and write excel accesing cells. 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.

Export contents of DBGrid to Excel or ClipBoard

Alexander 3, 6 13 CSV File Access So I made it last so that Lista doesn’t leak if it does raise an error. Email Required, but never shown. I will save it for future use. 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. Next; end; finally Stream.

  EVODIO ESCALANTE PDF

If you want a fast export of raw data, just export your recordset ADODataset. Paul Scot Delphi Developer. No’amNewman depending on the datataypes the csv approach might give more trouble in convertions e. TObject ; var Stream: Sign up using Facebook.

Sun, 29 Aug In order to use the variant array approach, you have to know dbrgid many rows you have in the query. All are very good points Or directly write to file with AssignFile etc. Sergio Gonzale Delphi Developer. Otherwise it may be simpler to use the csv approach which I gave in that question.

I suggest you start using these, then if you have specific questions about code parts not working, post them here. I’m afraid I don’t undestand this point.

Reproduced Delphi DBGrid derived Excel method

Post as a delph Name. I’m just curious if that’s the best way to do it Tue, 24 Aug Thanks for the procedure! Stack Overflow works best with JavaScript enabled.