Solved

Opening SQL Server 2005 report in PDF format in new window.

Posted on 2007-04-09
3
212 Views
Last Modified: 2010-03-19
Hi,
I am calling SQL Server 2005 report from my asp.net application using web services.Everything looks fine except for that report is being rendered in same window.I want this pdf report to open in a different window.Can any one tell me what lines of code should i add it get this done.
Below are the last few lines of my code....and can any one tell me how do i get the response in a pop up or seperate window....

Response.ClearContent();
Response.AppendHeader("content-length",result.Length.ToString());
Response.ContentType = "application/pdf";
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
0
Comment
Question by:aspnetdev
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 18876662
You have to have the request ask that the response be delivered to a new window, not the same window from which the request comes.
0
 

Author Comment

by:aspnetdev
ID: 18877924
can you be more elaborate>
0
 
LVL 23

Accepted Solution

by:
Christopher Kile earned 125 total points
ID: 18878694
It depends on how you open the request.  If you're clicking an anchor link, add "javascript:  return window.open('" to the front of the url, then add "', '_blank';" to the end of the url.  This changes the url link to a Javascript call that opens the url in a new window.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question