none
SUBREPORT ACCEPTS ONLY FIRST VALUE FROM MULTIVALUE PARAMETER

    Question

  • Hi everyone,
    I have a problem passing a multivalue parameter to a subreport. I have
    a main report that has a chart and a table. I set one of the datafields
    (a chart's column) on the chart to be clickable to jump to a subreport.
    I pass two parameters. One of them is a multivalue parameter. It is
    called 'Name.' I right-clicked the datafield -> properties -> action ->
    jump to report. I selected my report, then clicked parameters, chose my
    parameter name. For parameter value I went to expression -> parameters,
    chose my parameter - Name and this is what is being assigned by
    default:

    =Parameters!Name.Value(0)

    I understand it is using an array and only the first value is picked
    up. How do I pass more than just first value? My parameter in subreport
    is set to multivalue. That does not do the job automatically. The
    second parameter is passed fine since it is only one value for each
    column.

    Any help will be appreciated!

    Thanks,
    Stan

    Thursday, April 06, 2006 3:24 PM

Answers

All replies

  • I found an expression to convert an array to a comma delimeted list of values:

    =Join(Parameters!Name.Value, ", ")

    But if I select more than one value in my main report I get no data in subreport. The values are displayed correctly in the parameter window like -- 2, 5. If I select multivalue in subreport's parameter peoperties of my subreport and select more than one value in main report, I get nothing again. If I click on the drop-down of multi-select and type each individual values in its own line I get data back! By the way, by selecting only one value I can get data in my subreport. What I can do to use multi-values?

    Stan

    Thursday, April 06, 2006 3:44 PM
  • If the subreport parameter is also marked as multi/value parameter, then just use the following expression:

    =Parameters!Name.Value

    See also this related thread which discusses various scenarios in more detail: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=163803&SiteID=1

    -- Robert

    Friday, April 07, 2006 5:35 PM
    Owner
  • Hi Robert,

    If use use =Parameters!Name.Value you will only pass first value in the parameter because RS uses arrays. If you try =Parameters!Name.Value, the RS changes it to =Parameters!Name.Value(0) since the parameter is multivalue.

    I have a different problem now. I managed to pass the parameters to a sureport. I use Join function
    =Join(Parameters!MarketingVehicleID.Value, vbcrlf)

    The newline character is for the multivalue drop down.

    I click on the column and see my subreport with all the parameters
    passed. They are seen in dropdowns but the data is not there. If I
    click "View Report" my data shows up. In other words, parameters are
    being passed but the subreport requires refresh. I can not explain this
    behavior. Any ideas?

    Thanks,
    Stan

    Friday, April 07, 2006 7:45 PM
  • Robert,

    You are right! I just found a problem. By default RS places multivale paramater as:

    Parameters!Field.Value(0)

    I removed the (0)! It  works!

    Stan

    Friday, April 07, 2006 8:16 PM