Last post Oct 04, 2012 05:18 AM by venkatesh.naik
Sep 28, 2012 04:24 AM|venkatesh.naik|LINK
I have few reports in my webpage, on click event i want to export all the 3 reports in (PDF or excel),
I can do it for a single report. I am exporting it from a report viewer control in my web form.
I have done But it but i get file currupted error.
1) I have created array list of type byte
List<byte> list = new List<byte>();
bytes = ReportViewer1.ServerReport.Render("Excel", null, out mimeType, out encoding, out extension, out streamids, out warnings);
byte bytes = bytes1.SelectMany(a => a).ToArray(); ///I have combined all the list of byte to single byte
I generates a file but currupted one.
thanks in advance.
Oct 01, 2012 01:06 AM|santosh.jagdale|LINK
Actually, the ReportViewer control has already included a toolbar which provides export to excel or pdf.
You can add the toolbar, then you can export data from ReportViewer to excel or pdf.
For more information
Configuring and Using the ReportViewer Toolbar
For further question
Oct 01, 2012 01:23 AM|venkatesh.naik|LINK
I have 20 reports in need to export these 20 reports in one click, For these 20 reports I am using for loop, for each report in am storing it in a array list of bytes and converting complete array list of bye to single byte array.
Oct 01, 2012 02:12 AM|santosh.jagdale|LINK
try below code in loop for number of reports
byte bytes = ReportViewer1.LocalReport.Render(
"Excel", null, out mimeType, out encoding,
out streamids, out warnings);
FileStream fs = new FileStream(@"c:\output.xls",
fs.Write(bytes, 0, bytes.Length);
Label1.Text = "Report exported to output.xls";
Oct 04, 2012 05:18 AM|venkatesh.naik|LINK
I have 20 reports in SSRS i want to export all 20 reports in one PDF or EXCEL in one click.