FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Output directly to Printer
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Output directly to Printer
Posted: Tue Feb 10, 2015 02:43 PM
To All

When I create my reports, I always start my print with this code which always loads the printer pallet .. How can I create a report that creates the printer object, but does not show the printer pallet.

Here is my current code .. I pass "P" to print and "V" to the previewer

Rick Lipkin
Code (fw): Select all Collapse
PrnSetCopies(nCopies)

IF cVIEW = "V"
   PRINTER oPRINT FROM USER                ;
   PREVIEW MODAL                           ;
   NAME "Print Routine for INVOICE "+cRepairNumber

   IF EMPTY( oPRINT:hDC )
      MsgInfo ( "Report Cancelled" )
      Return(.f.)
   ENDIF

ELSE

   // do not want the printer pallet here

   PRINTER oPRINT from USER                ;
   NAME "Print Routine for INVOICE "+cRepairNumber

   IF EMPTY( oPRINT:hDC )
      MsgStop ( "Printer not Ready !" )
      RETURN(.f.)
   ENDIF

ENDIF

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Output directly to Printer
Posted: Tue Feb 10, 2015 02:46 PM

Rick,

what's a "printer pallet"?

EMG

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Output directly to Printer
Posted: Tue Feb 10, 2015 03:26 PM

Enrico, thanks for asking that--it was my question too.

After looking at the graphic, I am assuming he means the printer selection dialog.

Rick, just leave off the "from user" clause. However, you are going to have to define the printer (oPrint) via code. I have a function to save and restore the user's printer if that is useful.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Output directly to Printer
Posted: Tue Feb 10, 2015 06:38 PM

James and Enrico

YEP .. After I posted this thread I removed 'from user' and the output went directly to the printer ..

Thanks
Rick Lipkin

Continue the discussion