B
BillE
Visual Studio 2008, vb.net, Windows forms application
I have created a report, and I want to export the contents to a csv file.
I can export to Excel or PDF using the ReportViewer save icon.
I can also export to Excel like this:
dim rpt as Byte() = ReportViewer1.LocalReport.Render("EXCEL",Nothing,
Nothing, Nothing, Nothing, Nothing, Nothing)
my.Computer.FileSystem.WriteAllBytes("C:\export.xls", rpt, False)
But if I try to export to a CSV like this:
dim rpt as Byte() = ReportViewer1.LocalReport.Render("CSV",Nothing,
Nothing, Nothing, Nothing, Nothing, Nothing)
my.Computer.FileSystem.WriteAllBytes("C:\export.csv", rpt, False)
I get an error:
"specified argument was out of the range of valid values. parameter name
format"
I read many places which say this should work.
Thanks
Bill
I have created a report, and I want to export the contents to a csv file.
I can export to Excel or PDF using the ReportViewer save icon.
I can also export to Excel like this:
dim rpt as Byte() = ReportViewer1.LocalReport.Render("EXCEL",Nothing,
Nothing, Nothing, Nothing, Nothing, Nothing)
my.Computer.FileSystem.WriteAllBytes("C:\export.xls", rpt, False)
But if I try to export to a CSV like this:
dim rpt as Byte() = ReportViewer1.LocalReport.Render("CSV",Nothing,
Nothing, Nothing, Nothing, Nothing, Nothing)
my.Computer.FileSystem.WriteAllBytes("C:\export.csv", rpt, False)
I get an error:
"specified argument was out of the range of valid values. parameter name
format"
I read many places which say this should work.
Thanks
Bill