>>>Is there a Fox command for bringing up a print dialog that allows the user to select number of copies?
>>>
>>>I've tried SYS(1037)and GetPrinter. SYS(1037) offers more than GetPrinter, but neither offer number of copies.
>>>
>>>TIA,
>>>Chuck
>>
>>The dialogue I get from the command below gives me a # of copies option:
>>
>>report form myreport to printer prompt
>>
>>The printer is an HP Laser 5.
>
>Thanks Mark. Actually, in my post, I should've asked is there a way to do this other than with PRINTER PROMPT.
>
>What I'm trying to accomplish is to have the user tell me which printer he intends to use before I go to REPORT FORM so that I can get a total page count and express "Page x of y" when the report prints. Here's my coding example at present (which isn't offering a number of copies option):
>
>
>* Print Report
>SELECT curHatFiRep
>PUBLIC mTotalPages
>STORE 1 TO mTotalPages
>* PRINTER PROMPT with =SYS(1037)...
>* Otherwise, you may have an issue with the printable area
>* being different between the default printer and the one
>* chosen by the user. Potentially, this could mean that the
>* "TO FILE" report would have a slightly different page count
>* than the "TO PRINTER" report because the number of lines
>* that can fit on the page may be slightly different.
>=SYS(1037)
>REPORT FORM HatFiRep TO FILE TempRept.prn NOCONSOLE
>DELETE FILE TempRept.prn
>STORE _PageNo TO mTotalPages
>REPORT FORM HatFiRep TO PRINTER NOCONSOLE
>
>
>I hate to bring up the printer dialog again by adding TO PRINTER PROMPT in the REPORT FORM statement. At best, it's a hassle for the user to have to experience 2 printer dialog boxes at report time. At worst, it looks like I'm not a clean programmer and it may mess up the page count on the report.
You can create a Report dialog box that lets the user select a printer and choose the number of copies. Store the number of copies in the _PCopies system variable. Then surround your second REPORT FORM with PRINTJOB ENDPRINTJOB. It's been a while since I used it, but I think it should work this way. Your code would look like this...
REPORT FORM HatFiRep TO FILE TempRept.prn NOCONSOLE
DELETE FILE TempRept.prn
STORE _PageNo TO mTotalPages
PRINTJOB
REPORT FORM HatFiRep TO PRINTER NOCONSOLE
ENDPRINTJOB
David.