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!

Setting Paper Source in Crystal Rpts 5.0 1

Status
Not open for further replies.

KevinO

Programmer
Mar 10, 2000
1
US
I am modifying a VB 5 application and want to add a listbox on a print menu to provide paper source options (ie top tray, manual feed, etc.). The VB 'PaperBin' property does not work (I assume b/c the Crystal Report properties override the VB properties) and I've been unable to find a similar Crystal Reports property. Any help would be greatly appreciated.
 
I am not familiar with VB, but the Crystal Reports print engine in version 7 and prior doesn't have full printer function support. Missing stuff includes duplex and (I think) paper source - I think Crystal defaults to the tray based on paper size used in the report.<br>
Version 8 apparently adds this missing functionality, although I haven't tried it out to confirm whether the promise conforms to the reality. <p>Malcolm Wynden<br><a href=mailto:wynden@island.dot.net>wynden@island.dot.net</a><br><a href= > </a><br>
 
Hi,<br><br>I posted a question on this and then solved it myself. This is the code I used which I am sure you can modify<br><br>While Not rsSuppliers.EOF<br><br>DoEvents<br><br>With Mode<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;.dmDefaultSource = 1<br>&nbsp;&nbsp;&nbsp;&nbsp;.dmFields = &H200<br><br>End With<br><br>Response% = PEOpenEngine()<br><br>strSQL = &quot;&quot;<br>strSQL = &quot;isnull({Beneficiaries.dt_Date_of_Update}) and isnull({Suppliers.dt_date_of_update}) and {Suppliers.c_Practice_Number} = '&quot; & Trim(rsSuppliers!c_Practice_Number) & &quot;' and {Member_Statement.c_Recipient_of_Payment} = 'S'&quot;<br><br>Job% = PEOpenPrintJob(&quot;C:\Program Files\Seagate Software\Crystal Reports\Supplier Claims.rpt&quot;)<br><br>Response% = PESetSelectionFormula(Job%, strSQL)<br><br>Response% = PEOutputToPrinter(Job%, 1)<br><br>Response% = PEGetNPages(Job%) ' How many pages in report<br><br>Pages% = Response%<br><br>If Pages% &lt;&gt; 0 Then<br><br>Counter = Counter + 1<br><br>If Pages% = 1 Then<br><br>Mode.dmDefaultSource = 2 ' Lower tray<br><br>Response% = crPESelectPrinter(Job%, Printer.driverName, Printer.DeviceName, Printer.Port, Mode)<br><br>Response% = PEStartPrintJob(Job%, 1)<br><br>Else<br><br>Mode.dmDefaultSource = 1&nbsp;&nbsp;' Upper Tray<br><br>Response% = crPESelectPrinter(Job%, Printer.driverName, Printer.DeviceName, Printer.Port, Mode)<br><br>With Options<br><br>&nbsp;&nbsp;&nbsp;&nbsp;.collation = PE_UNCOLLATED<br>&nbsp;&nbsp;&nbsp;&nbsp;.nReportCopies = 1<br>&nbsp;&nbsp;&nbsp;&nbsp;.StructSize = PE_SIZEOF_PRINT_OPTIONS<br>&nbsp;&nbsp;&nbsp;&nbsp;.StartPageN = 1<br>&nbsp;&nbsp;&nbsp;&nbsp;.stopPageN = Pages% - 1<br><br>End With<br><br>Response% = PESetPrintOptions(Job%, Options)<br><br>Response% = PEStartPrintJob(Job%, 1)<br><br>Mode.dmDefaultSource = 2 ' Lower tray<br><br>Response% = crPESelectPrinter(Job%, Printer.driverName, Printer.DeviceName, Printer.Port, Mode)<br><br>With Options<br><br>&nbsp;&nbsp;&nbsp;&nbsp;.collation = PE_UNCOLLATED<br>&nbsp;&nbsp;&nbsp;&nbsp;.nReportCopies = 1<br>&nbsp;&nbsp;&nbsp;&nbsp;.StructSize = PE_SIZEOF_PRINT_OPTIONS<br>&nbsp;&nbsp;&nbsp;&nbsp;.StartPageN = Pages%<br>&nbsp;&nbsp;&nbsp;&nbsp;.stopPageN = Pages%<br><br>End With<br><br>Response% = PESetPrintOptions(Job%, Options)<br><br>Response% = PEStartPrintJob(Job%, 1)<br><br>End If<br><br>Response% = PEClosePrintJob(Job%)<br><br>End If<br><br>rsSuppliers.MoveNext<br><br>Wend<br><br>rsSuppliers.Close <p>Mike Meredith<br><a href=mailto:mikemer@iafrica.com>mikemer@iafrica.com</a><br><a href= > </a><br>Also run a seasonal business pressing olive oil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top