Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crystal Report
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00412813
Message ID:
00412881
Vues:
14
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform