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

Report not applying selected parameter

0 views
Skip to first unread message

ahmed

unread,
Nov 23, 2009, 12:06:01 PM11/23/09
to
I have created an rdl file in vs2005 that has a string parameter that is
pulling from a dataset. when I preview the report I select the parameter
from the dropdown list and click View Report yet the report does not filter
based on the selected parameter. What am I missing?

Bruce L-C [MVP]

unread,
Nov 23, 2009, 3:13:58 PM11/23/09
to
Can you post your query?

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

"ahmed" <ah...@discussions.microsoft.com> wrote in message
news:C16D6269-7E84-4AD0...@microsoft.com...

ahmed

unread,
Nov 24, 2009, 3:16:01 PM11/24/09
to
SELECT * From PES_Object a
JOIN PES_Class b on b.cls_UID = a.cls_UID
WHERE b.nsp_UID = 2

"Bruce L-C [MVP]" wrote:

> .
>

Bruce L-C [MVP]

unread,
Nov 24, 2009, 4:57:06 PM11/24/09
to
Your query needs to have the parameter specified in it. You can also have a
filter that is applied after pulling all the data over. But it is much
better to use a query parameter.

When you have a query parameter RS automatically creates a report parameter
and maps them to one another.

Modify your query like so:


SELECT * From PES_Object a
JOIN PES_Class b on b.cls_UID = a.cls_UID

WHERE b.nsp_UID = @NSPUID

RS will automatically create a report parameter called NSPUID. So, if you
already have a report parameter just use @ExistingParameterName in place of
@NSPUID.

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

"ahmed" <ah...@discussions.microsoft.com> wrote in message

news:8BA29774-D67A-4B23...@microsoft.com...

ahmed

unread,
Nov 25, 2009, 9:01:02 AM11/25/09
to
I get an error when I try to execute

TITLE: Microsoft Report Designer
------------------------------

An error occurred while executing the query.
There was a problem executing the stored procedure: Must declare the scalar
variable "@NSPUID".

------------------------------
ADDITIONAL INFORMATION:

There was a problem executing the stored procedure: Must declare the scalar
variable "@NSPUID". (System.Data)

------------------------------
BUTTONS:

OK
------------------------------


"Bruce L-C [MVP]" wrote:

> .
>

Bruce L-C [MVP]

unread,
Nov 25, 2009, 10:53:20 AM11/25/09
to
Are you calling a stored procedure? You didn't say that you were.

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

"ahmed" <ah...@discussions.microsoft.com> wrote in message

news:676DE2A8-6A33-4016...@microsoft.com...

ahmed

unread,
Nov 25, 2009, 12:51:03 PM11/25/09
to
Yes, sorry for that lake of info. Is that a problem?

"Bruce L-C [MVP]" wrote:

> .
>

Bruce L-C [MVP]

unread,
Nov 25, 2009, 2:07:33 PM11/25/09
to
Yes. How your stored procedure is written makes a different. If your stored
procedure does not have a parameter then there is no way for RS to pass the
value to it. If you added a parameter to the stored procedure then in RS you
need to open up the dataset in design mode and refresh it so that RS
recognizes that there is a parameter.

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

"ahmed" <ah...@discussions.microsoft.com> wrote in message

news:68470C79-54C1-447F...@microsoft.com...

0 new messages