Confused by Connected Parameters

(2 posts) (2 voices)

Tags:

No tags yet.

  1. SteveD, Member

    I realise that there is another thread regarding connected parameters, but rather than clutter that one up I have started another because I cannot seem to get connected parameters to work at all.

    In my report the fourth parameter is a popup that depends on the value of the second parameter.

    The procedure that provides the lookup values is as follows:
    CREATE PROCEDURE sp_DBR_puLocations @mydbr_param2 int AS BEGIN

    CREATE TABLE #tmp( LocationID int NOT NULL, Location varchar(50) NOT NULL, LocationAbbreviation varchar(max) NOT NULL ) insert into #tmp exec ABSDEV.dbo.qselStorageLocationsByWarehouse @mydbr_param2; select LocationID, Location from #tmp drop table #tmp

    END GO

    If under the parameter queries section for parameter 4 I use
    sp_DBR_puLocations 76
    then everything works as expected

    However if I use
    sp_DBR_puLocations
    then the report errors because the stored procedure wants a value passing to it.

    If I use
    sp_DBR_puLocations mydbr_param2
    I get an error generate due to the stored procedure trying to convert a nvarchar to an int.

    If I use
    sp_DBR_puLocations @mydbr_param2
    I get an error about @mydbr_param2 not being declared.

    How do I connect parameter 4 to parameter 2?

  2. myDBR Team, Key Master

    Steve,
    your parameter query is ok. Please note that connected parameters are connected to another popup / radio button. So in your case the second parameter should be a popup or a radio button. In parameter query definitions, use just the procedure name. myDBR will automatically read the parameters and pass appropriate parameter to the parameter query.

    P.S You could use some other prefix that 'sp_DBR' as it is reserved for the reports and if you use it in parameters, myDBR just wants to create it as a report every time you create a new report.

    --
    myDBR Team


Reply

You must log in to post.