Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot Print Drill Down Pages

Status
Not open for further replies.

rdeleon

IS-IT--Management
Jun 11, 2002
114
US
I am using CR 8.5 with VB 6.

My users needed the ability to select one of many printers, so I used the following:

Private Sub CRViewer1_PrintButtonClicked(UseDefault As Boolean)

UseDefault = False 'Don't use the default printer

Dim cOrientation As CRPaperOrientation
Dim cSize As CRPaperSize

'Get the report's current orientation and paper size
cOrientation = crrpt.PaperOrientation
cSize = crrpt.PaperSize

crrpt.PrinterSetup Me.hwnd 'Call the Printer Setup dialog

'Loop through the Printers collection to ensure the correct _
printer gets set for the report
Dim p As Printer
For Each p In Printers
If p.DeviceName = crrpt.PrinterName Then
crrpt.SelectPrinter p.DriverName, p.DeviceName, p.Port
Exit For
End If
Next p

'Reset the report's PaperOrientation and PaperSize properties _
to override the "new" printer's defaults
crrpt.PaperOrientation = cOrientation
crrpt.PaperSize = cSize

'Prompt the user for page numbers, copies, etc.
crrpt.PrintOut True, 1

End Sub

The problem I have is some of the reports have drill-down capabability. When a user attempts to print a drilled-down portion of a report, the entire report is printed. Does anyone know how to tell CR which "view" to print?

Rene'
 
I'm not sure if this is the right answer, but it seems to work.

I adjusted my code to:

Private Sub CRViewer1_PrintButtonClicked(UseDefault As Boolean)

Dim cOrientation As CRPaperOrientation
Dim cSize As CRPaperSize

'Get the report's current orientation and paper size
cOrientation = crrpt.PaperOrientation
cSize = crrpt.PaperSize

crrpt.PrinterSetup Me.hwnd 'Call the Printer Setup dialog

'Loop through the Printers collection to ensure the correct _
printer gets set for the report
Dim p As Printer
For Each p In Printers
If p.DeviceName = crrpt.PrinterName Then
crrpt.SelectPrinter p.DriverName, p.DeviceName, p.Port
Exit For
End If
Next p

'Reset the report's PaperOrientation and PaperSize properties _
to override the "new" printer's defaults
crrpt.PaperOrientation = cOrientation
crrpt.PaperSize = cSize

End Sub

If you set the UseDefault property to false, you have to use the PrintOut method to print. The printout method does not appear to have the ability to select which "view" to print (at least, I couldn't figure out how to do it). Since I am letting the user select the new printer and I am setting the printer values programmatically, I do not need to call the PrintOut method.

Seems to work.

Rene'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top