Passthrough with Multivalue parameter

  • I have an SSRS report that has, among others, two parameters I want to pass to a pass through SSRS report. The first parameter is a Project ID and can only have one value. The second parameter is a Job Number which can have multiple values. In both reports I have a query that is used to limit the acceptable Job Numbers to those associated with he selected Project ID. Both are drop downs.

    I have these two columns in the result set of the primary report's stored procedure.

    , @JobNum AS pJobNum

    , REPLACE(@JobNum,',',CHAR(13)+CHAR(10)) AS passJobNum

    with results...

    @JobNum: 001585-1-1,001585-2-1,001585-3-1,001585-4-1

    passJobNum: 001585-1-1

    001585-2-1

    001585-3-1

    001585-4-1

    I have also tried to use Split and JOIN on @JobNum. Nothing I have tried has resulted in more than one value being passed to the pass through query and often nothing gets passed.

    Any ideas, help, etc. will be greatly appreciated.

    Thanks,

    John
    SQL Rebel without a Where Clause
    SQL/Epicor/Prophet21/VISUAL/e.i.e.i.o.

  • One more thing... I even tried creating a parameter that would identify when the second report is being generated as a pass through called PassTrue. I then pass True with the parameters and added

    =IIf(Parameters!PassThru.Value=True,Parameters!passJobNum.Value,Nothing)

    as the default value for the JobNum parameter. No Joy.

    John
    SQL Rebel without a Where Clause
    SQL/Epicor/Prophet21/VISUAL/e.i.e.i.o.

  • It turned out to be easy...

    =Split(Join(Parameters!JobNum.Value,","),",")

    John
    SQL Rebel without a Where Clause
    SQL/Epicor/Prophet21/VISUAL/e.i.e.i.o.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply