Results 1 to 3 of 3

Thread: Printing Report Details (VB6 with CR9)

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    45

    Printing Report Details (VB6 with CR9)

    I am generating a report from VB6 using CR9 which shows a selection of information (this works perfectly)

    In this report preview there is a "Print" button and when I select it it comes up with a very brief window with the printer settings (only telling me what printer i am printing to and if i want to print all the pages or a range of them) I would like to view a more detailed print window which gives me the normal options that I would usually get when selecting the print button on all other applications!!

    Any help would be much appreciated!!

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Printing Report Details (VB6 with CR9)

    Are you using the CRViewer to preview the report? It contains a PrintButtonClicked event. You can then code the prompting for a printer, maybe using the CommonDialog or PrinterSetupEx of the Report object.

    Set the UseDefault argument of the Event to False and Crystal will not show any dialogs.

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    45

    Re: Printing Report Details (VB6 with CR9)

    This is one of the most annoying pieces of code I have had the pleasure is sorting out...

    I found loads of help of the subject out there and thanks to brucede for your help, that got the ball rolling and I ended up with the following code:

    VB Code:
    1. Dim Report As CRAXDRT.Report
    2.  
    3. Private Sub CRView_PrintButtonClicked(UseDefault As Boolean)
    4.  
    5. UseDefault = False
    6.  
    7. 'Brings up the print dialog box
    8. Report.PrinterSetup Me.hwnd
    9.  
    10. 'If 'Cancel' is selected will cancel print job
    11. If Err.Number <> 0 Then
    12.     Report.PrintOut False
    13. Else
    14. 'Means 'OK' was selected and will print out
    15.     Report.PrintOut True
    16. End If
    17.  
    18. End Sub

    It is commented and basically when the print button is selected a print dialog box appears allowing for more detailed changed to be made to the report printing settings, hope other people find this helpful...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width