How do I pass multiple paramters to reporting services?

I want to pass parameters from a web form to a reporting service report. 

I have 3 report parameters defined.  Emplnbr, StartDate, EndDate.  The spelling is exactly the same in the report parameters asn in this statement.
This is my statement

Response.Write("<script language = ""Javascript"">var win=window.open(""http://becsql/ReportServer %2fHuman+Services/Training%2fTrainingReport&rs:Command=Render&rc:Parameters=False&Emplnbr=" & ddlEmpl.SelectedValue & ", &StartDate=" & StartDate.Text & ",&EndDate=" & EndDate.Text & ", null, location=no, menubar=yes, status=no, toolbar=no, scrollbars=yes, resizable=yes, fullscreen=no"");</script>")

this is my error

Reporting Services Error

Answer this question

How do I pass multiple paramters to reporting services?

  • r_amarnath

    Thanks again James.  You have made my day.  I fixed the runtime error.  I guess I just had to put the answers in quotes.    I am new to this stuff and the syntax is what gets me everytime.

    Shiloy 

  • sethi.bhushan

    Thank You James.  I got past the dates but now get a runtime error on the word no. I cut out location=no and then I got a runtime error on yes.

    runtime error has ocurred.  Do you wish to debug.  line:0 Error: 'yes' is undefined.  What am I missing now  

    thanks
    Shiloy

  • Joshua Wise

    Try this instead:

    Response.Write("<script language = ""Javascript"">var win=window.open(""http://becsql/ReportServer %2fHuman+Services/Training%2fTrainingReport&rs:Command=Render&rc:Parameters=False&Emplnbr=" & ddlEmpl.SelectedValue & "&StartDate=" & StartDate.Text & "&EndDate=" & EndDate.Text & """, null, location=no, menubar=yes, status=no, toolbar=no, scrollbars=yes, resizable=yes, fullscreen=no);</script>")

    You had commas separating the parameters. Parameters should be sent as:

    &Param1=val1&Param2=val2

    Also, you placed the closing quotes around the URL in the wrong place. You placed it after fullscreen=no, which caused reporting services to receive the following value for EndDate:
    EndDate.Text & , null, location=no, menubar=yes, status=no, toolbar=no, scrollbars=yes, resizable=yes, fullscreen=no

  • KevinInIndy

    Hello Shiloy,

    the reports work fine if i run them in the designer but when i deploy them

    i am facing with the same "rsReportParameterTypeMismatch" error,

    i know that its because when the server executes the datetime report parameters, it turns the format from mm.dd.yy to dd.mm.yy, and i do not know how to avoid this, or why this happens.

    if you find a solution to this problem, can you give it to me so i can use this reporting tool.

    thank you


  • WaveSlam

    Glad I could help. One thing that I've found helpful when outputting JavaScript from C# or VB.NET is to use single quotes rather than double in the JavaScript. In JavaScript,

    <a href='mylink.aspx'>

    works exactly the same as

    <a href="mylink.aspx">

    Why does this matter Because it's easier to match quotes and you don't have to worry about escaping quote marks. For instance:

    Response.Write("<script language = 'Javascript'>var win=window.open('http://becsql/ReportServer %2fHuman+Services/Training%2fTrainingReport&rs:Command=Render&rc:Parameters=False&Emplnbr=" & ddlEmpl.SelectedValue & "&StartDate=" & StartDate.Text & "&EndDate=" & EndDate.Text & "', null, location=no, menubar=yes, status=no, toolbar=no, scrollbars=yes, resizable=yes, fullscreen=no);</script>")

    Note much difference, but I find the above version easier to verify that I've correctly matched all my quote marks.

    BTW - <script language='JavaScript'> is deprecated (i.e. no longer recommended). The current way to denote this is <script type='text/javascript'>


  • How do I pass multiple paramters to reporting services?