Reputation: 69
i have used report viewer for one of my website page and it's working fine but when i go for export , the exported file name is report4.pdf ,but i don't want that i want to give some other name instead of report4.pdf. how can i do this, Please help.
Upvotes: 6
Views: 18545
Reputation: 59
I hope you are using SSRS report.
Export option takes the SSRS file name to create pdf file.
Ex: if you have SSRS file somereport.rdl then when you export the report, pdf file name becomes somereport.pdf
You can change the export file name as follows
Upvotes: 0
Reputation: 36
frmReportViewerX.reportViewer1.LocalReport.DisplayName = "Report Name";
Upvotes: 1
Reputation: 21
Its Just one line of Code. Thats it. RptViewer.ServerReport.DisplayName = "Your File Name Goes Here";
Upvotes: 1
Reputation: 129
ReportViewer1.LocalReport.DisplayName = "Your Other Name Goes Here";
it's only works with ExportDialog not in PrintDialog.
Upvotes: 12
Reputation: 85
Add a button for download and write code to render the report and write to the stream. Something like:
byte[] bytes = ReportViewer1.ServerReport.Render(filetype, null, out mimeType, out encoding, out extension, out streamids, out warnings);
context.Response.BinaryWrite(bytes);
Upvotes: -1