Groups | Blog | Home
all groups > sql server reporting services > august 2004 >

sql server reporting services : report viewer in new window


G. Dean Blake
8/20/2004 5:34:24 PM
I'm executing report server from my aspx page as follows:
response.redirect(http://localhost/reportserver?%2fCPlusReports%2fResults&Da
taSource=c:\temp\mydataset.xml)

this seems the easiest way.

Is there any way I can get the report to display in a new window so that my
aspx page still shows?
Thanks,
G

Teo Lachev
8/21/2004 9:17:34 AM
Dean,

In your ASP.NET page, you can generate script to run in the window onload
event. In your case, this script would call window.open passing the report
URL. Just make sure that you put in window onload to prevent cookie lost if
you are using Forms Authentication. This will guarantee that the script will
run when the page and cookies are loaded.

--
Hope this helps.

----------------------------------------------
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.manning.com/lachev
Home page and blog http://www.prologika.com
----------------------------------------------

[quoted text, click to view]

G. Dean Blake
8/21/2004 1:43:30 PM
if you mean when my aspx page is just loading, I don't have the information
yet to generate the report. A purpose of my aspx page is to develop a
dataset to generate the report. My response.redirect is in answer to a
button click event.

[quoted text, click to view]

Teo Lachev
8/21/2004 9:00:58 PM
No, I meant using Page.RegisterClientScriptBlock in your ASP.NET page to
generate dynamically the browser window.onload call instead of using
Response.Redirect, e.g.

StringBuilder sb=new StringBuilder();
sb.Append("<script language=\"javascript\">");
sb.Append("function requestReport");
sb.Append("{");
sb.Append("window.open (<'your report URL'>");
sb.Append("}");
sb.Append("</script>");

this.Page.RegisterClientScriptBlock("script",sb.ToString());

--
Hope this helps.

----------------------------------------------
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.manning.com/lachev
Home page and blog http://www.prologika.com
----------------------------------------------

[quoted text, click to view]

AddThis Social Bookmark Button