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):||14 October 2005|
|PDF File Size:||5.89 Mb|
|ePub File Size:||14.34 Mb|
|Price:||Free* [*Free Regsitration Required]|
If you want a fast export of raw data, just export your recordset ADODataset. Dbgfid 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. FieldName ; end; s: That’s why I use a dbGrid I too was going to give the reference that Bummi gave. And bummi’s right; if at all possible export the underlying dataset. And if We want export an ClientDataset to Excel then what we do? Paul Scot Delphi Developer. I suggest you wxport using these, then exporr you have specific questions about code parts not working, post them here.
I did this procedure and so far it works fine. Agustin Seifert 1, 12 TObject ; var Stream: In order to use the variant array approach, you have to know how many rows you have in the query. If delpni dont have a recordset, you have to iterate your dataset and write excel accesing cells.
Sun, 29 Aug Okay I will go have a look at that.
delphi – Exporting data from a DBGrid to Excel – Stack Overflow
Tue, 24 Aug Alexander 3, 6 13 I would write a generic procedure taking the dbgrid as a parameter and then follow the properties to retrieve header and data. Sergio Gonzale Delphi Developer. Otherwise it may be simpler to use the csv approach which I gave in dwlphi question.
Or directly write to file with AssignFile etc.
: export a TDBGrid to excel without OLE?
EnableControls can raise an exception since it causes the screen to update, indirectly. The ‘try’ is in the wrong place, though. Do not export the DBGrid, export the dataset stackoverflow. CSV File Access I will save it for future use.
Reproduced Delphi DBGrid derived Excel method
Sign up or log in Sign up using Google. I have the feeling that I’m reinventing the wheel