Using Multi-Valued Parameters in SSRS from within ASP

  • I have a report that is run using the following kind of ASP code in a web page:

    Dim rpt, mvlist

    mvlist = "ACCEPT,OPEN"

    Set rpt = New Report

    rpt.host = REPORT_SERVER_URL

    rpt.Name = REPORT_NAME_123

    rpt.Format = "HTML4.0"

    rpt.AddParameter "PARAM_1", "01/01/1900"

    rpt.AddParameter "PARAM_2", "01/01/2999"

    rpt.AddParameter "MULTI_VALUE", Split(mvlist)

    'rpt.AddParameter "MULTI_VALUE", mvlist

    rpt.ExecuteClientUrl

    I've tried this numerous ways, but when I try using Split, I get a VB type mismatch from IIS, and when I just pass along a comma delimited list, I get an invalid value message from SSRS. How is this done programmatically?

    I'm leaning toward changing the report data source query to not use just IN, and instead use FIELD IS NULL OR FIELD IN (@MULTI_VALUE). Thoughts?

    Steve

    (aka sgmunson)

    :w00t::w00t::w00t:

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • I had a sudden recall of something I saw a long time ago, and tried the following:

    rpt.AddParameter "EVENTTYPE", "ACCEPT"

    rpt.AddParameter "EVENTTYPE", "OPEN"

    This worked, but when I fleshed this out into a loop that added all the values from the list, the

    ExecuteClientUrl creates a URL over 1500 characters long, and the resulting URL causes IE to

    show a page called:

    Internet Explorer cannot display the webpage

    I don't really know why, or what causes this, but needless to say, the URL ends up with encoded

    equal signs and ampersands together with EVENTTYPE repeated once with each of the various

    values. A most curious result. I'm still seeking a better result, but I'm not real hopeful at this point.

    Steve

    (aka sgmunson)

    :w00t::w00t::w00t:

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • As it turns out, my last post is indeed the only way to pass the multi-value parameter and have it work. Unfortunately, that significantly elongates the URL, and while IE is capable of up to 2083 characters, the specific environment into which this report must live has enacted a limit of just 260 characters between segments, which is designed to help with security by avoiding the kinds of security problems that can result from overly long URLs.

    While I had a brainstorm that allowed me to limit how many EVENT TYPE values were being fed in based on other parameter data, the URL limitation meant that only 8 or so values could afford to show up in the URL, and the database data consistently has thousands of records qualifying with more than 8 different types of events.

    It was most certainly an interesting exercise, from which I learned a lot.

    Steve

    (aka sgmunson)

    :-):-):-)

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

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

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