kajal
kajal

Reputation: 55

how to open pdf file in new window which is generated through reportviewer in C#.net

Byte[] results = reportviewer.LocalReport.Render("PDF");
Response.ContentType = "Application/pdf";
Response.OutputStream.Write(results, 0, results.Length);
Response.End();

here by using this code the report is opening in same browser as pdf file. but i want to open this pdf file in a new window. can u help me please..??

Upvotes: 1

Views: 1398

Answers (2)

jjchiw
jjchiw

Reputation: 4425

Maybe in the presentation instead of a link like

<a href="/report">click me </a>

send it to target _blank

<a href="/report" target="_blank">click me </a>

Upvotes: 1

Naveed Butt
Naveed Butt

Reputation: 2901

you can do a window.open('newwindow.aspx'); from java script and then in the new page write the code to export to PDF on page load. This is the easiest possible solution I can come up with right now.

Upvotes: 1

Related Questions