Skip to Content
0
Former Member
Feb 17, 2011 at 08:51 PM

Error Missing Parameter Values

51 Views

I am very inexperinced in VB and ASP.Net.

That being said I have used forums and tutorials to develop the code below.

In the code I have hard coded some values to be passed to the report for testing...see num_inv and ser_inv.

When I run the code I get an error "Missing Parameter Values".

If I remove the lines that setparamervalues and turn on the enableparamaterpromt the report works fine and I can manually enter the values and see my completed report.

More Details...

The Crystal Report uses an ODBC connection to a SQL Server. I am only using one view to feed the report and there are no subreports. I am buidling the web app in VS2010 with the crystal reports version for VS2010 installed.

Dorry if I didn't give enough information...I don't know what else is relavant.

Any help would be greatly appreciated!

    Private Const PARAMETER_FIELD_NAME_1 As String = "Invoice"
    Private Const PARAMETER_FIELD_NAME_2 As String = "Serial"

    Private Sub WebForm2_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        ConfigureCrystalReports()
    End Sub
    Private InvoiceReport As ReportDocument
Private Sub ConfigureCrystalReports()
        Dim num_inv As Integer
        Dim num_ser As Integer
        num_inv = 880822
        'Request.QueryString("inv")
        num_ser = 1
        'Request.QueryString("ser")
        InvoiceReport = New ReportDocument()
        Dim reportPath As String = Server.MapPath("S36 Invoice.rpt")
        InvoiceReport.Load(reportPath)
        InvoiceReport.SetParameterValue(PARAMETER_FIELD_NAME_1, num_inv)
        InvoiceReport.SetParameterValue(PARAMETER_FIELD_NAME_2, num_ser)
        CrystalReportViewer1.ReportSource = reportPath

  
    End Sub