How do I print selected pages in crystal viewer in vb6

Posted on 2009-02-10
Last Modified: 2013-11-25
I have small application in VB6 with crystal viewer.
It works fine, but when I want to print only selected pages I couldn't. I push Print button but option button "Pages" is dissabled.
What I have to do?
With CRViewer1

   .Top = txtFromdate.Top

   .Width = Me.Width - 5000

   .Height = Me.Height - 800

   .DisplayGroupTree = False

   .EnableRefreshButton = False

   .DisplayToolbar = True

   .EnableToolbar = True

   .EnableDrillDown = True

   .ReportSource = crxRpt


End With

Open in new window

Question by:BAHApps
    LVL 100

    Assisted Solution

    Have you tried using the PRINT SETUP button?

    One way to do this is to add your own button to the viewer and print using it through code.


    Accepted Solution

    Finally what I did:

    Private Sub CRViewer1_PrintButtonClicked(UseDefault As Boolean)
    UseDefault = False
    On Error GoTo Cancel:
        CommonDialog1.Max = 1000
        CommonDialog1.CancelError = True
        CommonDialog1.Flags = cdlPDAllPages
        If CommonDialog1.Flags = cdlPDPageNums Then
            crxRpt.PrintOut False, , , CommonDialog1.FromPage, CommonDialog1.ToPage
        ElseIf CommonDialog1.Flags = cdlPDAllPages Then
            crxRpt.PrintOut False
            MsgBox "Please select 'All' or 'Pages'", vbCritical
            Exit Sub
        End If    
    Exit Sub

    MsgBox "Printing cancelled"
    Exit Sub

    End Sub

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now