Results 1 to 2 of 2

Thread: CRP with Stored Procedure parameters - Question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2008
    Location
    Philippines
    Posts
    218

    CRP with Stored Procedure parameters - Question

    Hi guys,

    I'm trying to load a report on crystal based on the Stored Procedure I created in MSSQL Server 2000. I created new connection from Crystal Report then I selected the stored procedure name. There is only 1 parameter on it.

    My problem is when I run the report, it says "pr_Product_Report" expects parameter "supplierID". I'm not sure if the way I supplied the value of parameter below is correct. I'm just guessing if the code below is right, or you can advice me something that will work fine.



    Code:
        Public Sub ProductReport(ByVal iSuppID As Integer)
            Dim crLogOn As New CrystalDecisions.Shared.TableLogOnInfo
            Dim ServerName As String = ""
            Dim DBName As String = ""
    
            Dim Val1 As New ParameterDiscreteValue()
            Dim rpt As New CrystalReport1
            Dim Field1 As New ParameterField
    
    
            Val1.Value = iSuppID
            Field1.CurrentValues.Add(Val1)
    
            crLogOn.ConnectionInfo.IntegratedSecurity = True
            crLogOn.ConnectionInfo.ServerName = "myServer"
            crLogOn.ConnectionInfo.DatabaseName = "Northwind"
            rpt.Database.Tables(0).ApplyLogOnInfo(crLogOn)
    
    
            Form2.CrystalReportViewer1.Visible = True
            Form2.CrystalReportViewer1.ReportSource = rpt
            Form2.Show()
        End Sub
    Please help. I'm new in Vb.Net

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: CRP with Stored Procedure parameters - Question

    Moved to Reporting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width