[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I print selected pages in crystal viewer in vb6

Posted on 2009-02-10
2
Medium Priority
?
188 Views
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
   .ViewReport
End With

Open in new window

0
Comment
Question by:BAHApps
2 Comments
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 80 total points
ID: 23601945
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.

mlmcc
0
 

Accepted Solution

by:
BAHApps earned 0 total points
ID: 23604262
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
    CommonDialog1.ShowPrinter
   
    If CommonDialog1.Flags = cdlPDPageNums Then
        crxRpt.PrintOut False, , , CommonDialog1.FromPage, CommonDialog1.ToPage
    ElseIf CommonDialog1.Flags = cdlPDAllPages Then
        crxRpt.PrintOut False
    Else
        MsgBox "Please select 'All' or 'Pages'", vbCritical
        Exit Sub
    End If    
Exit Sub

Cancel:
MsgBox "Printing cancelled"
Exit Sub

End Sub
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

830 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