Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Parameters to Server Side SSRS 2005 from VB.Net 2005 1

Status
Not open for further replies.

ousoonerjoe

Programmer
Jun 12, 2007
925
US
I have been trying to locate so much as a sample of code on how to do this no avail.

I have a report with 3 arguments that in turn are passed to the Stored procedure and populates the Report. How do I pass these 3 arguments over from a VB.Net 2005 application?

Code:
    Private Function SelectFormReport(ByVal SelFrmRpt As String) As Boolean
        Dim CmdSql As New DataUpdates
                        CmdSql.CommandTxt = "EXEC cst_Rpt_APY320L '" & StartDate.Date & "', '" & EndDate.Date & "', " & CompID
                        CmdSql.ExecuteCmd()
                        ReportName = "/AcctPay/Apy320L"
                        frmSvrReport.Show()
    End Function

Public Class frmSvrReport

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.ReportViewer1.ServerReport.ReportPath = ReportName
        Me.ReportViewer1.RefreshReport()
    End Sub
End Class

Any suggestions or tip you can provide are highly appreciated. Thank you.

"If I were to wake up with my head sewn to the carpet, I wouldn't be more surprised than I am right now.
 
Are you looking for something like this?

Code:
parmList.Add(New ReportParameter("SPParm1_Name", Parm1_Val, True))
parmList.Add(New ReportParameter("SPParm2_Name", Parm2_Val, True))
parmList.Add(New ReportParameter("SPParm3_Name", Parm3_Val, True))

'*** Pass the Parameter(s) to the Report ***
rptSRSViewer.ServerReport.SetParameters(parmList)
pInfo = rptSRSViewer.ServerReport.GetParameters()

'*** See If the Current Parameter is Valid ***
If (pInfo(0).State = ParameterState.HasValidValue) Then
    '*** Process and Render the Report ***
    SetReportParameters = True
End If

--------------------------
Web/.net Programmer & DBA
Central PA
 
yes. thank you. Here's a star for the effort and appreciation.

I figured out a solution and posted it in another thread. thread796-1501182

"If I were to wake up with my head sewn to the carpet, I wouldn't be more surprised than I am right now.
 
No need to give me a star, but thanks! I had to figure that out myself a few months ago. I'm glad to help!

--------------------------
Web/.net Programmer & DBA
Central PA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top