0
votes

I can run the query in management studio and it runs fine, but when I try to run it in ssrs 2008, or pass the parameters from an MVC app, no report. I am guessing there is some kind of issue with my report parameter settings but I cant see it.

query:

SELECT p.PersonId, p.FirstName + ' ' +  p.LastName as Name, p.FirstName, p.Address, p.City, p.State, p.Zip, l.BodyText, l.CreatedBy
FROM Person p Join Letter l on p.personid = l.personid
where l.PersonId = @PersonId
and l.letterid = @LetterId

Parameter settings: @PersonId & @LetterID are both integers, no default value, internal.

link from the app:

("http://MyServer/ReportServer/Pages/ReportViewer.aspx?/Trespass/Letter&rs:Command=Render&PersonId=" + PersId + "&LetterId=" + LetterId);

When clicked, it renders this url:

http://MyServer/ReportServer/Pages/ReportViewer.aspx?/Trespass/Letter&rs:Command=Render&PersonId=60&LetterId=22

which looks good to me.

Ideas?

1
Are you sure they're internal parameters? By definition, internal parameters must have a default, though this can be null. Though if they are internal, that explains why they're not working - internal parameters cannot be affected by a URL at all.Ian Preston
When you paste your url in browser does that work? http://MyServer/ReportServer/Pages/ReportViewer.aspx?/Trespass/Letter&rs:Command=Render&PersonId=60&LetterId=22Anup Agrawal
@Ian Preston - Thankyou, your comment led me to the solution which that my parameters should have been hidden, not internal. All is working swimmingly now. Throw up and answer so I can mark it answered.BattlFrog
Thanks for the update, @teahou! Seemed like a good chance that was the issue, but only a guess so hence just the comment. Added as answer now.Ian Preston

1 Answers

1
votes

As per your comment, it seems like the parameters were Internal when they should've been Hidden only.

Creating Report Parameters and Setting Report Parameter Properties explains why:

You can set options that control parameter visibility in the published report. Setting the Hidden and Internal options provides different levels of visibility. You can hide the parameter on the parameter input area of the published report, yet set values for it on a report URL or in a subscription definition. If you set a parameter to Internal, it is not exposed in any way except in the report definition. An internal parameter must have a default value, which can be null if the Allow null value option has been selected.