keithtbe
asked on
database
can anybody tell me the code of how to call a crystal report from visual basic?
pols help
urgent
pols help
urgent
This is a procedure that will help you print CR report from VB:
Public Sub PrintCRReport(ByVal pstrReportFile As String, _
Optional ByVal pstrCriteria As Variant, _
Optional ByVal pbytDestination As Byte = 0)
Dim intResult As Integer
With fMainForm.CrystalReport1
If Not IsMissing(pstrCriteria) Then
.SelectionFormula = pstrCriteria
End If
.WindowState = crptMaximized
.ReportFileName = App.path & "\" & pstrReportFile
.Destination = pbytDestination
.WindowTitle = App.Title & " - " & pstrReportFile
intResult = .PrintReport
If intResult <> 0 Then
MsgBox "Error occured." & _
vbCrLf & .LastErrorNumber & ": " & .LastErrorString, _
vbCritical + vbOKOnly, _
"Print error"
End If
End With
End Sub
Public Sub PrintCRReport(ByVal pstrReportFile As String, _
Optional ByVal pstrCriteria As Variant, _
Optional ByVal pbytDestination As Byte = 0)
Dim intResult As Integer
With fMainForm.CrystalReport1
If Not IsMissing(pstrCriteria) Then
.SelectionFormula = pstrCriteria
End If
.WindowState = crptMaximized
.ReportFileName = App.path & "\" & pstrReportFile
.Destination = pbytDestination
.WindowTitle = App.Title & " - " & pstrReportFile
intResult = .PrintReport
If intResult <> 0 Then
MsgBox "Error occured." & _
vbCrLf & .LastErrorNumber & ": " & .LastErrorString, _
vbCritical + vbOKOnly, _
"Print error"
End If
End With
End Sub
ASKER
sorry
what i want is to call the report that i generate in the crystal report and then view it in the visual basic
i hope that u can help me tp write the code to call the report from crystal report inside the visual basic
i hope that u know what i mean and help me
thanks alot
what i want is to call the report that i generate in the crystal report and then view it in the visual basic
i hope that u can help me tp write the code to call the report from crystal report inside the visual basic
i hope that u know what i mean and help me
thanks alot
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>what i want is to call the report that i generate in the crystal report and then view it in the visual basic
Depending on the version you are using, maybe you won't be able to see it IN vb. You need the version 6 or higher with the CR viewer in order to make your report sited on your form. See http://www.seagatesoftware.com/products/crystalreports/default.asp
Depending on the version you are using, maybe you won't be able to see it IN vb. You need the version 6 or higher with the CR viewer in order to make your report sited on your form. See http://www.seagatesoftware.com/products/crystalreports/default.asp
ASKER
thanks alot
i wil try and see
i wil try and see
No probs.
:)
ChaseZero
:)
ChaseZero
ASKER
another question
how can i ah set decimal point?
i mean when there is a text box that let people key in data
and how can i fixed the decimal point ?
another one
can u pls tell me ahhhhhhhhhhh
i want to fix that only number to key inside the text box and not text
so how to write the code?
and vice versa
thanks alot
how can i ah set decimal point?
i mean when there is a text box that let people key in data
and how can i fixed the decimal point ?
another one
can u pls tell me ahhhhhhhhhhh
i want to fix that only number to key inside the text box and not text
so how to write the code?
and vice versa
thanks alot
ASKER