-
Feb 18th, 2003, 12:45 PM
#1
Thread Starter
Addicted Member
Crystal Reports RDC / Allow User to Select Printer
I need to know how to allow the user to select a printer when printing Crystal reports as opposed to just sending to the default printer.
I am currently designing my reports using RDC. I have a single form (frmRptView), with only the CRViewer control, which I call to view all of my reports.
Here is the code I am using to view a report:
Private Sub cmdViewReport_Click()
Dim Report As New NameOfReport
With frmRptView
.CRViewer1.ReportSource = Report
.Show
.CRViewer1.ViewReport
End With
End Sub
Now I am looking to find the code to utilize under the CRViewer1_PrintButtonClicked event procedure to allow the user to select printer. Under Crystal Care Technical Support I found the following code:
Private Sub CRViewer1_PrintButtonClicked(UseDefault As Boolean)
'Do not use the default printer dialog
UseDefault = False
'Display the Windows Standard Printer Setup dialog box.
Report.PrinterSetup Form1.hWnd
'Print the report without displaying the default printer dialog.
'If the option to set the number of pages is required then
'pass a value of True.
Report.PrintOut False
End Sub
Problems:
1> In my form (with the CRViewer1 control), it does not recognize Report as object.
2> If I hardcode in the name of the report it asks me to enter parameter values. I should mention this is a paramaterized report.
So first things first, If someone could tell me how I can refer to the report from the form which I view the report that would be a start.
-
Feb 19th, 2003, 06:46 AM
#2
Frenzied Member
When using the crystal viewer:
Code:
Private Sub CRViewer_PrintButtonClicked(UseDefault As Boolean)
UseDefault = False
CReport.PrinterSetup Me.hwnd
CReport.PrintOut True
Set CReport = Nothing
CRViewer.Visible = False
End Sub
-
Feb 19th, 2003, 06:54 AM
#3
Frenzied Member
Set Report.PrintOut False = True, to show the user the dialog box in order to choose a printer.
-
Aug 4th, 2020, 12:10 AM
#4
Registered User
Re: Crystal Reports RDC / Allow User to Select Printer
Originally Posted by mel_flynn
When using the crystal viewer:
Code:
Private Sub CRViewer_PrintButtonClicked(UseDefault As Boolean)
UseDefault = False
CReport.PrinterSetup Me.hwnd
CReport.PrintOut True
Set CReport = Nothing
CRViewer.Visible = False
End Sub
Can you further explain where to define CReport ..
I have a form in vb project i.e. Report which hold crviewer and I use to call this from from any other reporting form. .. i.e. create object of this and pass parameters ... now how to to this ???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|