We help IT Professionals succeed at work.
Get Started

Crystal Report Error "Missing parameter values." while Printing

Last Modified: 2012-05-11
Dear all

I have a Windows service and I am passing the value to the Crystal report when the service is running .
After passing the value i am printing the report.

So i have written a code to pass the value and print the report.

Here is the code

   Dim crReportDocument As VinPrint = New VinPrint
        Dim SQLDM As New DataManager.SqlServerDataManager
        Dim DTable As New DataTable

        DTable = SQLDM.GetDataTable("Select TABDNO 'Bodynumber' ,TAEGMD+ '    ' + TAEGNO 'Engine',TAKEYN 'KEY',JCEXTC 'Color',JCGWMI+JCGVDS+TAFRSQ + '~' + TAPRDM 'VIN' from F91TAF join F91JCF on TABDNO=JCBDNO where JCBDNO='" & Bodynumber & "'")

        If DTable.Rows.Count > 0 Then

                ' System.Diagnostics.Debugger.Break()

                crReportDocument.SetParameterValue("Body", DTable.Rows(0).Item("Bodynumber"))
                crReportDocument.SetParameterValue("Engine", DTable.Rows(0).Item("Engine"))
                crReportDocument.SetParameterValue("Key", DTable.Rows(0).Item("KEY"))
                crReportDocument.SetParameterValue("Ecol", DTable.Rows(0).Item("Color"))
                crReportDocument.SetParameterValue("Vin", DTable.Rows(0).Item("VIN"))
                crReportDocument.SetParameterValue("suf", "TS")
                ' crReportDocument.SetParameterValue("Body", DTable.Rows(0).Item("Suf"))


                crReportDocument.PrintToPrinter(1, False, 1, 1)

               'doing some SQL operations on successful printing.

            Catch ex As Exception
                WriteToLogFile("Error while Printing  " & ex.Message)
            End Try

        End If

In the line "     crReportDocument.PrintToPrinter(1, False, 1, 1)" i get error Missing parameter values.

In Crystal report i have total 6 parameters.

Where am i going wrong please let me know the solution.

Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE