Solved

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

Posted on 2007-04-09
3
184 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now