Skip to Content
0
Former Member
Mar 28, 2007 at 07:23 PM

Parameters not being passed from VB.net 2005

16 Views

Post Author: Paul Mitton

CA Forum: .NET

Hi

I have a VB.net 2005 app that I am trying to pass parameters to several embedded crystal reports. None of them receive the parameters and the report always prompts for the parameters to be entered.

Product: Crystal Reports Professional

Version: XI

Patches Applied: Recent new download

Operating System(s): XP Pro / Visual Studio 2005 Pro

Database(s): SQL 2000/2005

Error Messages: NoneSteps to Reproduce: Below is a sample of the VB code used to call the crviewer. The commented out code is various methods used to try and pass the parameter.

Private Function btnSOPCommission_Print()

SOPCommissionReport = New SOPCommission()

'Dim pvCompanyName As ParameterDiscreteValue = New ParameterDiscreteValue()

'pvCompanyName.Value = "City"

'Me.DriverStatementsReport.SetParameterValue("CompanyName", pvCompanyName)

Me.SOPCommissionReport.SetParameterValue(0, "City")

Me.SOPCommissionReport.SetDataSource(Me.DsDR)

Me.crvReportViewer.ReportSource = Me.SOPCommissionReport

'Dim crvparaCompanyName As ParameterField

'Dim crvparadvCompanyName As ParameterDiscreteValue = New ParameterDiscreteValue()

'crvparaCompanyName = Me.crvReportViewer.ParameterFieldInfo("CompanyName")

'crvparadvCompanyName.Value = "City Wide"

'crvparaCompanyName.CurrentValues.Add(crvparadvCompanyName)

Me.crvReportViewer.Visible = True

'Me.crvReportViewer.RefreshReport()

Return True

End Function

Thanks for any help

Paul