Open Url in new window and pass in parameters

I am working on reporting services and have a report called 'Dashboard' that summarises the content of other reports. There are 2 fields that are used to open the new reports, both open the URL in a new window, one opens it with the default parameters, the second needs to have different parameters passed in.

The field opening the URL in a new window is working fine, this is the code:

="javascript:void(window.open('" & Fields!ReportURL.Value & "&rs:Command=render&rc:Parameters=true','_blank'))"

The field that should open the report with set parameters is still opening using the default parameters, the code I've used for this is:

="javascript:void(window.open('" & Fields!ReportURL.Value & "&rs:Command=render&bViewExceptions=2&','_blank'))"

The parameter is bViewExceptions.

The URL to open the report is stored in the field ReportURL.

Does anyone have any ideas how I can get the second field with the parameters to override the default values as I'm tearing my hair out.

Many thanks.
more ▼

asked Nov 24, 2011 at 07:41 AM in Default

Mrs_Fatherjack gravatar image

4.7k 60 62 66

what is the result if you remove the ,'_blank' from the 2nd version?
Nov 24, 2011 at 08:19 AM Fatherjack ♦♦
No difference, it comes up the same as it did before.
Nov 24, 2011 at 09:14 AM Mrs_Fatherjack
can you add two columns to the report and simply display the two URLs and then copy/paste them into a browser and get the functionality you are trying for? If not then the URL is being formed badly and needs changing. Once it displays as text and will work as a pasted link them work on getting it clickable
Nov 25, 2011 at 02:15 AM Fatherjack ♦♦
Will give this a go. Thank you
Nov 25, 2011 at 02:17 AM Mrs_Fatherjack

I have just worked it out; the URL I set in the table was:


when it should be:


Many thanks for all the help, next time I'll try to ensure I give ALL the relevant information!!
Nov 25, 2011 at 03:38 AM Mrs_Fatherjack
(comments are locked)
10|1200 characters needed characters left

1 answer: sort newest
Add &rs:ClearSession=true as one of your parameters :)
more ▼

answered Nov 24, 2011 at 12:21 PM

Scot Hauder gravatar image

Scot Hauder
6.1k 13 15 18

I put it in as below and it's still opening the default values:

="javascript:void(window.open('" & Fields!ReportURL.Value & "&rs:ClearSession=true&rs:Command=render&bViewExceptions=2&rs:ClearSession=true'))"
Nov 25, 2011 at 12:48 AM Mrs_Fatherjack
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Nov 24, 2011 at 07:41 AM

Seen: 1408 times

Last Updated: Nov 24, 2011 at 07:41 AM