Crystal Reports

How to use Crystal Reports in VB6?
Data report in VB6 is equal to Crystal Reports?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
We are still to the first version of the "Data Report". And it is still very buggy. For example, you need a DLL to print landscape!!!

Crystal Reports is better than DR. It is a commercial product. Microsoft gives a lite version of CR to VB programmers (at least with version 5 and 6).

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
All Courses

From novice to tech pro — start learning today.