none
Display parameter defined via code vs. stored proc RRS feed

  • Question

  • How do you display a parameter defined in code. Up to now, I have displayed parameters very easily because my reports were being driven by stored sprocs that contained input parameters,  "@inputParameter".

    This report in question is driven by a "PARAMETER-LESS" stored proc. No parameter, SELECT * FROM MYTABLE.

    My reports are defined in a seperate Report Project file (rptproj) created in VS05 using the MS SQL SERVER REPORTING SERVICES DESIGNES VERS. 9.00. The reports are deployed to a REPORTSERVER.

    My host application is a VB.NET WINFORMS app developed in VS08, of which there is a Form that contains a ReportViewerControl. I set several properties on the repviewer like processingmode, reportpath, repserverurl and networkcredentials. Then, I code;

    Dim paramList as ReportParameter() = {New ReportParameter("parm1", sometextboxvaluefromtheprevious-referring-form)}

    ReportViewer1.ServerReport.setParameters(paramList)

    My code compiles just fine(there are actually two params, so the array has 2 elements, "beg_date", and "end_date"). My question is how to recieve these variables on the rdlc, the report. I have a textbox, and when right-clicking and selecting Expression, I don't understand how to recieve those parameter variables. If it was a sproc that defined parameters like @myTSQLparameter, it would nicely show up after clicking Parameters in the "Edit Expression" window. The reason I can't modify the sproc is because it uses a "View" that is complex, I wish not to modify the "View" to define the parameters in question, "beg_date" and "end_date".

    Can someone please share some ideas with me. THANKS !

     

     


    love dot net
    Wednesday, May 12, 2010 1:43 PM

Answers

  • In the report designer, select Report, then Report Parameters, I added two parameters name-ing them exactly "beg_date" and then "end_date", to match the following line. That is how I 'RECIEVED' the parameters in the rdlc file THAT were defined in code-behind IN the WinForm hosting the reportviewer control.

    Dim paramList as ReportParameter() = {New ReportParameter("beg_date", begdate), New ReportParameter("end_date", enddate)}

    Thanks for looking, I hope this helps someone else out there!

     


    Model before code.
    • Marked as answer by Danny Rosales Wednesday, May 12, 2010 3:43 PM
    Wednesday, May 12, 2010 3:30 PM