Export query results to flat file or CSV?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sean

Export query results to flat file or CSV?

Post by sean » Mon 11 Apr 2005 16:16

Hi,

I was wondering if there is a (generic) easy way of exporting all column + rows in a MyQuery to a CSV (or even excel..) file?

Thanks in advance,

Sean

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 12 Apr 2005 12:49

There is no such possibility directly. But you can use TMyBackup in text mode or that is more correct use any third-party report builder. We cannot suggest you any certain reporter, please try to search for it in any component storage for Delphi.

guest

Post by guest » Thu 14 Apr 2005 15:30

hi sean, you can use EMS QuickExport / Quickimport components...
or this one (more powerfull) , it is free for non commercial apps :

http://www.scip.be/index.php?Page=Compo ... anguage=EN

sean

Post by sean » Fri 29 Apr 2005 13:45

On a similar vein, is there a way of accessing TCRDBGrid cell values, as opposed to the underlying dataset? I've spent hours looking through the various properaties and see many options for setting column specific things like filed names, titles etc, but not for iterating through each row and column.

If rows are selected, "SelectedRows" would seem to allow access to all values, but what about all rows?

i.e. I'd like to use something like
CRDBGrid.Row.Column[j].AsString

Thanks in advance..

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 29 Apr 2005 14:36

CRGrid doesn't provide such possibility and we are not planning to add export feature now.

sean

Post by sean » Fri 29 Apr 2005 20:40

OK, thanks for the quick reply.

Guest

Post by Guest » Fri 29 Apr 2005 20:51

As regards EMS QuickExport noted above, it does look quite interesting, and even the commercial version is not expensive. But I can also do this (granted with more effort) with Excel Server components.

I use Grid method GetCellParams to change the values & colours of some celles as displayed in the grid, and also set title etc. of course I could do this all over again using Excel and the Dataset, but I'm coming across the situation often now where I make a Grid and would like to export exactly to Excel.

sean

Post by sean » Tue 10 Jan 2006 23:31

Hi,

I'm back to this problem, for another project, almost a year later: how to dump the contents currentl shown in a Gid, so that I can for example export it to excel.

I've never worked with 'copy and paste', and was there a way to perhaps highlight several rows, right click and do "copy" or something?

==> Could you have any same code on how to access the rows and columns of several rows that have been highlighted?

Thanks.

Post Reply