Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Report
Message
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00412813
Message ID:
00412881
Views:
13
>How to call a Crystal report's form from a command button
>thank's all

You can use something like this:
Public Sub PrintReport(ByVal pstrReportFile As String, _
                          Optional ByVal pbytDestination As Byte = 0)
Static sbytNbDataFile As Byte
Dim bytI As Byte
Dim intResult As Integer

    With fMainForm.CrystalReport1

        
        .WindowState = crptMaximized
        
        .ReportFileName = App.path & "\" & pstrReportFile
        .Destination = pbytDestination
        .WindowTitle = App.Title 
        
        'Lance l'impression
        intResult = .PrintReport
        If intResult <> 0 Then
            MsgBox "Error occured." & _
                   vbCrLf & .LastErrorNumber & ": " & .LastErrorString, _
                   vbCritical + vbOKOnly, _
                   "Error"
        End If
    End With
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform