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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to export the data report as an html file or excel file?

Status
Not open for further replies.

ii128

Programmer
May 18, 2001
129
US

How to export the data report as an html file or excel file?
 
Well, when you show the report in your program. Exporting to HTML is one of the options that are automatically included with the Data Report object.
If you want to export using code, below is an example from MSDN library which I think is pretty clear.
As for exporting to Excel, there is no easy way that I know of, if anyone else wants to jump in here with some advice. I'd probably create the Excel file and then export each data piece to whatever cells I needed to.
Good luck
Stacey

ExportReport Method Example
The first example uses the ExportReport method to display the Export dialog box. The second example exports the file without displaying the Export dialog box. The third example specifies an ExportFormat object to use when exporting the report.

Private Sub ExportTheReport()
DataReport1.ExportReport , , True, True
End Sub

Private Sub ExportWithoutDialog()
' Export to a file named Output.htm, overwriting if needed.
DataReport1.ExportReport rptKeyHTML, "C:\Temp\Output", True, False
End Sub

Private Sub ExportMyReport()
' Export to a file named Daily.htm using the MyReport ExportFormat.
DataReport1.ExportReport "MyReport", "C:\Temp\Daily", True, False
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top