SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Passing Report Parameters in URL
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/21/2012 :  03:04:24  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
I am trying to pass parameters in the URL to my reports but they seem to be ignored. The parameter textboxes are not populated and no reports are generated. Is there any configuration setting on the Report Server that could prevent the reports from using my parameters (I have asked IT but no reply yet)?

Here is an example. The name of the parameter this report takes is "TestID" (the prompt is "Test ID". It is of string type (converted to integer in the query) but I have tried integer type as well. I expect the report to use my parameter if I pass it like

http://servab16/Reports$SQL2005/Pages/Report.aspx?ItemPath=%2fPerformanceIndicators%2fStruxureWare%2fUnofficial+Reports%2fStruxureWare+Defects+Linked+to+All+Instances+of+Test&TestID=18271

Should I pass the parameter in different ways depending on type? Any ideas why this does not work? It seems pretty straight-forward. Am I doing some stupid mistake?

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/21/2012 :  03:30:07  Show Profile  Reply with Quote
is TestID parameter mapped to a dataset for available values? If yes, values passed (in this case 18271) should be present in dataset result.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/21/2012 :  04:00:06  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
No, it is not. I have not set any available values. I now tried hard-coding 18271 as an available value and passing that in the URL. Still does not work. I want to be able to provide any integer (I would be able to query for the valid IDs but I certainly do not want a drop-down with 20000+ options).
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/21/2012 :  04:11:07  Show Profile  Reply with Quote
whats the data type of parameter?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/21/2012 :  04:22:16  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
It is of string type but I have tried integer type as well. No difference.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/21/2012 :  04:32:43  Show Profile  Reply with Quote
are you trying to pass url as is or are you generating url on the fly getting value from somewhere? if latter, can you check if value is getting passed properly?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/21/2012 :  05:03:26  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
My plan is to get the TestID value from another tool and automate opening of IE, passing it as a parameter, but right now I am only trying to pass the parameter as seen above by manually entering the URL in IE (to check that it works).
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/21/2012 :  05:32:58  Show Profile  Reply with Quote
Are you sure URL is correct? usually url will be of format


http://ServerName/ReportServer/Pages/ReportViewer.aspx?%Report+Folder%2fReports%2fReport+Name&rs%3aCommand=Render&Parametername={Value}

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/21/2012 :  07:09:10  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
I am sure I use the following URL to access the report without parameters:
http://servab16/Reports$SQL2005/Pages/Report.aspx?ItemPath=%2fPerformanceIndicators%2fStruxureWare%2fUnofficial+Reports%2fStruxureWare+Defects+Linked+to+All+Instances+of+Test

Adding &rs%3aCommand=Render&TestID=18271 or only one of the parameters makes no difference. Still no parameters used and no report generated.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/21/2012 :  07:16:04  Show Profile  Reply with Quote
hmm..then its not issue of parameters. i think its issue with url if report is not generated even without parameters

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/21/2012 :  07:28:26  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
Not sure we understand each other.

This URL always takes me to the report (if we by report mean also the textbox for the parameter) but no actual content is generated until I enter parameter value manually:
http://servab16/Reports$SQL2005/Pages/Report.aspx?ItemPath=%2fPerformanceIndicators%2fStruxureWare%2fUnofficial+Reports%2fStruxureWare+Defects+Linked+to+All+Instances+of+Test

Adding &rs%3aCommand=Render&TestID=18271 or only one of the parameters makes no difference.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/21/2012 :  07:47:16  Show Profile  Reply with Quote
can you explain how you've added parameter in report (along with properties you set)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/21/2012 :  08:07:49  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
In Visual Studio, after opening the report definition (.rdl), I select the "Layout" tab. I then open "Report Parameters" dialog from the main menu, click the "Add" button, set Name to "TestID", Data Type to "String" (Default) and Prompt to "Test ID". Then I just click the OK button to close the dialog, save the report definition and upload it to the server. Done.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/21/2012 :  09:04:40  Show Profile  Reply with Quote
then how are you linking parameter to report?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/21/2012 :  09:21:44  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
I use it in the following query:
SELECT * FROM td.BUG WHERE BG_BUG_ID IN (SELECT LN_BUG_ID FROM td.LINK WHERE LN_ENTITY_TYPE='TESTCYCL' AND LN_ENTITY_ID IN (SELECT TC_TESTCYCL_ID FROM td.TESTCYCL WHERE TC_TEST_ID=CAST(@TestID AS INT)))

Since I am able to generate my report by populating the parameter textbox manually, I suppose there is nothing wrong with how I use the parameter?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/21/2012 :  09:47:51  Show Profile  Reply with Quote
ok...so thats fine. Then only other issue should be URL itself. Can you try using report viewer URL in way I posted?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/21/2012 :  17:20:17  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
I already tried this without success:
http://servab16/Reports$SQL2005/Pages/Report.aspx?ItemPath=%2fPerformanceIndicators%2fStruxureWare%2fUnofficial+Reports%2fStruxureWare+Defects+Linked+to+All+Instances+of+Test&rs%3aCommand=Render&TestID=18271
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/21/2012 :  23:27:45  Show Profile  Reply with Quote
can you go to Reporting Services Configuration Manager (accessed from Start->Programs->Microsoft SQL Server -> Configuration Tools) and check the URL specified there?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nasu
Yak Posting Veteran

Sweden
50 Posts

Posted - 12/24/2012 :  04:27:31  Show Profile  Click to see nasu's MSN Messenger address  Reply with Quote
Thanks a lot for your patience so far. Unfortunately, I have no access to Reporting Services Configuration Manager on the Report Server. I will try to involve IT in this. Unfortunately, this will have to wait until after Christmas and New Year's holidays.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/24/2012 :  15:38:15  Show Profile  Reply with Quote
ok...no probs..let me know how you got on!

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

zung
Starting Member

1 Posts

Posted - 01/09/2014 :  07:52:24  Show Profile  Reply with Quote
if i use stored procedures mean then how do i pass parameter from URL?
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000