Hi all![]()
Often user get problem when they make setup of the VB project using the crystal report.
Report will be not display at the other Pc where crystal report is not installing.
1) How to use the crystal report
Make the report it is batter fro you that you make it using the DSN with the database.
For making the run time DSN you can use the code given by me in the VB
Code Bank in the General problem for the new user, See my Signature.
Open the Project Add the crystal report control
Right click on this control and set the property.
Report for the string value in the database
VB Code:
Private Sub Command1_Click() 'Report With String Dim S As String S = "{Table.Field}='" & Text1.Text1 & "'" With CrystalReport1 .ReportFileName = App.Path & "\ReportName.rpt" .SelectionFormula S .Action = 1 'Will Show The Report End With End Sub
Report for the integer value in the database
VB Code:
Private Sub Command1_Click() 'Report With Number Dim S As String S = "{Table.Field}=" & Text1.Text1 & "" With CrystalReport1 .ReportFileName = App.Path & "\ReportName.rpt" .SelectionFormula S .Action = 1 'Will Show The Report End With End Sub
Report when there is mix of number and the integer in the condition
VB Code:
Private Sub Command1_Click() 'Report With Number and string Dim S As String S = "{Table.Field}=" & Text1.Text1 & " and {Table.Field}='" & Combo1.Text & "'" With CrystalReport1 .ReportFileName = App.Path & "\ReportName.rpt" .SelectionFormula S .Action = 1 'Will Show The Report End With End Sub
For removing the error at the client Pc add the Dll database.dll, crystal32.ocx,p2sodbc.dll
You can change the selection formula according to above condition
Here table is the TableName
Field is the Table Field
Report Is the Crystal Report Name
![]()
![]()




Reply With Quote