Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Passing parameters thru query string not working

3 views
Skip to first unread message

richyoung

unread,
Apr 8, 2005, 4:19:02 PM4/8/05
to
I've got some Reporting Services reports that I'd like to be able to link to
from other dynamic web pages, passing parameters in through the HTTP GET
query string. Everything I've read seems to indicate that if I append
"&name=value" to the URL, it will load the report with the parameter set to
that value. However, my experience has been that it does not.
I've tried encoding the ampersand as &, I've tried setting up a form to
pass the value in via GET and POST, I've tried moving the parameter to the
beginning of the querystring.... Nothing seems to work, I still get a blank
report with a prompt for the parameter. (The report works fine when I hand
the parameter in manually.) Does anyone have experience with this behavior,
or have ideas on how to resolve it? This feels like a bug, and it's
dramatically reducing the usefulness of RS for our company.
In case it matters, we're running RS on SBS 2003 and designing reports in
Microsoft Visual Basic .NET, .NET Framework 1.1.4322 SP1, Development
Environment 7.1.3088. It's a little harder to get version numbers for RS
itself, but if anyone thinks it might matter, I can do so.

Bruce L-C [MVP]

unread,
Apr 8, 2005, 10:41:02 PM4/8/05
to
It is not a bug. There are two ways you can create the URL. Both ways will
pull up the report but only one way will fill the parameter values in. On
Monday I will post with the correct URL for you to use. Until then, one
thing to make sure of is that you are matching your parameter exactly, it is
case sensitive.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

"richyoung" <rich...@discussions.microsoft.com> wrote in message
news:CA827DA5-CBB0-40FB...@microsoft.com...

Bruce L-C [MVP]

unread,
Apr 11, 2005, 10:38:48 AM4/11/05
to
The below example specifies the directory starting from the root. I have
this because this particular report can reside in a different directory than
the report I am jumping to. If it is in the same directory you can just not
worry about specifying the directory. A couple of others things to note, I
use the globals variable so this will work regardless of where I deploy it.
Also, note that parameter values are case sensitive so you must match it
exactly or you will end up without values in your parameter fields. Also
note that you can add to this URL a command to tell it to hide the parameter
toolbar. Anyway, this should get you started.

=Globals!ReportServerUrl & "?/Inventory/Similar Loads&Manifest=" &
Fields!manifstdocno.Value &"&WasteIDNum=" & Fields!wasteidnum.Value


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

"richyoung" <rich...@discussions.microsoft.com> wrote in message
news:CA827DA5-CBB0-40FB...@microsoft.com...

richyoung

unread,
Apr 11, 2005, 5:29:02 PM4/11/05
to
Bruce-
Thanks for taking the time to reply. The problem you're addressing is a
good fix , but unfortunately it's not aimed at the problem I'm having. I
should have been more clear; the situation I'm using involves linking to a
report from a standard web page on a different server. So I'm constructing
my urls like so:<br>
http://www.url.com/Reports/Pages/Report.aspx?ItemPath=/path/to/the/report&pid=1234
<br>where the "pid=1234" thing is the parameter I'm trying to pass in,
named "pid" and expecting an integer value.
<br>
What I get is the report page with a blank prompt for the "pid" parameter,
instead of a report run against that parameter. As I mentioned before,
I've tried it with slashes and with "%2F" encoding for the slashes; I've
tried it with and without the "ItemPath=" segment, etc. About the only thing
that *does* work for me is linking from one report to another via the "jump
to a report" property in the Navigation tabs of my objects. I can even load
the (blank) report page in a browser, manually add the "&pid=1234" or
"&amp;pid=1234" string to the end (thereby guaranteeing that I'm not doing
anything wrong to the rest of the URL), hit enter, and still get a blank
report with a prompt for that parameter.
<br>
I've seen the same failure to import query-string parameters in several
different reports, and I'm at that uncomfortably familiar stage where I'm
feeling 85% certainty that it's not anything I'm doing wrong, and 15%
suspicion that I'm still overlooking something stupid and obvious.
<br>
Does that jog any ideas about what I might need to do to fix this? Thanks in
advance for any help you might be able to provide, as well as your efforts so
far.

--Rich

Ted K

unread,
Apr 11, 2005, 6:24:32 PM4/11/05
to
Use http://www.url.com/ReportServer to run reports. The /Reports
application is the Report Manager, and is not the place to go for URL
access. You can look up "URL access" in the BOL for more info, but
this will fix your problem with passing in parameters.

Ted

Bruce L-C [MVP]

unread,
Apr 11, 2005, 6:22:01 PM4/11/05
to
Take my solution and add it to a link in a report. Then look at the URL
generated when you execute it. What you want to do is definitely possible. I
can take a jump to URL link from my report, click on it and then copy the
URL from the address bar of IE. Do this to see how you should be assembling
the URL.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

"richyoung" <rich...@discussions.microsoft.com> wrote in message

news:7881CC3F-31D6-4922...@microsoft.com...

richyoung

unread,
Apr 11, 2005, 6:35:01 PM4/11/05
to
Bingo! That did it, thanks, Ted. The final form of the url was:
http://www.url.com/ReportServer/Pages/Report.aspx?%2fpath%2fto%2freport&rs:Command=Render&pid=1234

--Rich

Brian

unread,
Oct 26, 2005, 10:59:06 AM10/26/05
to
Thanks for the post Ted, I had the exact same problem and this worked
wonderfully!!

Brian

Vivran

unread,
Dec 16, 2005, 2:10:02 PM12/16/05
to
Wow!!!

Worked for me too. Thanks a lot!

Vivran

Marcial

unread,
Mar 15, 2006, 4:47:28 PM3/15/06
to
Greetings all,

Thanks to 'Ted K' for his solution regarding the way to address a reporting
server via URL.

...Also thanks to 'richyoung' for putting a scenario similar to mine into
words.

Here's my expanded scenario:

I am using ASP.NET 2.0 and have a bulleted list object of displaytype
hyperlink.
the hyperlink values are stored in a SQL Server2000 and represent paths to
individual ReportServer items. Using Ted K's path construction.

My problem is how do I capture a selected parameter value from the active
Aspx page and concatenate it to the end of the querystring parameter upon
clicking any bulletlisted hyperlink?

I hope my question is clear.

Thanks all

--
Application Engineer / DBA
UCLA SOM

0 new messages