Nasty2
October 16th, 2005, 08:56 AM
Hey,
I have an application developed with Visual basic 6 and Crystal Reports 9.
I am trying to pass a parameter to a crystal report and just can't seem to get it right.
I am opening the report (the report opens well but loads the saved data in the report) with the following code:
Module1.OpenDatabase
Dim s_myNumber As String
s_myNumber = Me.txtPurchaseOrderNumber.Text
Dim s_sql As String
sql = "...............WHERE 'POR_PURCHASE_ORDERS'.'ORDER_NUMBER'='" & s_myNumber & "'"
Dim rst As New ADODB.Recordset
rst.Open sql, conn
If Not (rst.EOF) Then
Dim myReport As New CrystalReport1
myReport.Database.SetDataSource (rst)
Dim frm As New Form2
frm.Show
frm.CRViewer91.Refresh
frm.CRViewer91.ReportSource = myReport
frm.CRViewer91.ViewReport
End If
Screen.MousePointer = vbNormal
The parameter "OrderNo" is set to "equal to 0000033960" in the report. What I want to do is pass my own parameter from VB6 and I do not want the pop-up screen that asks for the parameter value to show.
Hope you can help
Thanks
I have an application developed with Visual basic 6 and Crystal Reports 9.
I am trying to pass a parameter to a crystal report and just can't seem to get it right.
I am opening the report (the report opens well but loads the saved data in the report) with the following code:
Module1.OpenDatabase
Dim s_myNumber As String
s_myNumber = Me.txtPurchaseOrderNumber.Text
Dim s_sql As String
sql = "...............WHERE 'POR_PURCHASE_ORDERS'.'ORDER_NUMBER'='" & s_myNumber & "'"
Dim rst As New ADODB.Recordset
rst.Open sql, conn
If Not (rst.EOF) Then
Dim myReport As New CrystalReport1
myReport.Database.SetDataSource (rst)
Dim frm As New Form2
frm.Show
frm.CRViewer91.Refresh
frm.CRViewer91.ReportSource = myReport
frm.CRViewer91.ViewReport
End If
Screen.MousePointer = vbNormal
The parameter "OrderNo" is set to "equal to 0000033960" in the report. What I want to do is pass my own parameter from VB6 and I do not want the pop-up screen that asks for the parameter value to show.
Hope you can help
Thanks