Hi guys,
I'm a new member on this forum.
I use VB.NET 2005 for Visual Studio 2005 IDE. My problem is when I run my report with parameters. My report has a stored procedure. The connectivity (OLE DB) is my local computer.
When I run my report using my development machine, it works fine. But when I change the log-on info of the report, it says, "expects parameter..." Here is my code:
Public
Sub LoadReportProduct(ByVal iSuppID As Integer)
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Dim cbsmain As New CrystalReport1
For Each tbCurrent In cbsmain.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName =
"myLocalServer"
.DatabaseName =
"Northwind"
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
Dim pvCustPattern As New CrystalDecisions.Shared.ParameterValues()
Dim pdvCustPattern As New _
CrystalDecisions.Shared.ParameterDiscreteValue()
pdvCustPattern.Value = iSuppID
pvCustPattern.Add(pdvCustPattern)
cbsmain.DataDefinition.ParameterFields _
(
"@SupplierID").ApplyCurrentValues(pvCustPattern)
Form2.CrystalReportViewer1.ReportSource = cbsmain
Form2.Show()
End Sub
As you can see, the server name "myLocalServer" is defined and it works fine. But when I change the Server Name into 'TheRealServer', it says
Procedure 'pr_ProductReport' expects parameter '@SupplierID' , which was not supplier
How can I solve this error?
Thank you.
Edited by rpc86 - 19 Jun 2008 at 2:32am