Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

export to csv from datareport

Status
Not open for further replies.

unixisgood

Technical User
Jan 26, 2005
25
GB
Hi,
I would like to export a report as csv format which i have created with datareport function in VB 6.0. Is there a way to add export as csv option to datareport utility or do you know any free utility that i can use with VB?

Thanks
 

There is also the ExportReport method of the DataReport:

DataReport.ExportReport rptKeyText

and it supposedly works asynchronously (your application doesn't have to wait until the exporting is completed)

You could give it a try. I do not know how well it always works. I can imagine it uses a registry setting to determine the default schema used (delimiter, character set, formats for dates and numbers, etc.)

The GetString method used in the link above is an easy method, although with limited capabilities, but in case you are trying to export many many records, you should limit the number of records it returns at one time, using a loop until all records are processed.
 
Hi SBerthold ,
Thanks for answer but doesn`t Datareport exports to only text or html files? I need to export as excel or csv format.
 

I do not know how the text file looks. It was just an idea. I guess I was assuming as CSV, but probably am wrong. Give it a simple try. I only had played with the DataReport years ago and it doesn't work on my system any longer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top