David wrote:
> I have a subroutine that prints 20 different reports. I currently ask the
> user after each report where they want the output to go. I would like to
> simply ask at the beginning where they want the output for all 20 reports
to
> go. Can the "To Ask " be utilized early in the subroutine to
direct all
> output to wither the screen or printer. I tried to set a variable at the
> begining but it did not work. Thanks
>
>
Unfortunately, although you could use a REQUEST to ask the user, you
can't easily use a variable to decide the target (this was added around
SB 2001). You would have to modify the code to use an IF block for the
SELECT portion of each report.
|
We use a system like this:
1. Build your reports
2. Creat a Global variable to handle output options ie. PrintOpt$
3. Create a dialog to provide the user with options and set the PrintOpt$ in
the dialog
4. Note
PrintOpt$ = "P" = Printer
PrintOpt$ = "S" = Screen
PrintOpt$ = "F" = Fax
PrintOpt$ = "E" = Email
5. In the CALLED PROCEDURE add some print decisions
e.g. IF PrintOpt$ = "P" then
SET PRINTER PRINTR$,PRTPORT$,1,9,0,0,0,1
else if PrintOpt$ = "F" then
SET PRINTER FAX$,FAXPORT$,1,9,0,0,0,1
PrintOpt$ = "P"
else if PrintOpt$ = "E" then
SET PRINTER EMAIL$,EMAILPORT$,1,9,0,0,0,1
PrintOpt$ = "P"
end if
CALL THE REPORTS
6. Open each report control SBP file and edit the output
a$ = IF (PrintOpt$ = "P","TO PRINTER","")
a$ = IF (PrintOpt$ = "S","TO WINDOW","")
SELECT ;
WHERE InvRef_No.FINV = InvRef_No.FINVDTL AND Hide.FINVDTL = ""
AND
RetailClient_No.FINV = RetailClient_No.FRETAIL AND SectNo.FINV =
SectNo.FSECTION AND InvRef_No.FINV = InvRef_No%
ORDER REPORT sort.FINVDTL
rem TO PRINTER replace this with next line
EXECUTE a$
Hope this extended idea helps :)
Ian
www.soeasy.co.nz
"Neil Robinson" <neilr@superbase.co.uk> wrote in message
news:edev6n$os9$2@ipx22096.ipxserver.de...to
> David wrote:
>> I have a subroutine that prints 20 different reports. I currently ask
the
>> user after each report where they want the output to go. I would like
to
>> simply ask at the beginning where they want the output for all 20
reports
>> to
>> go. Can the "To Ask " be utilized early in the subroutine to
direct all
>> output to wither the screen or printer. I tried to set a variable at
the
>> begining but it did not work. Thanks
>>
>>
>
> Unfortunately, although you could use a REQUEST to ask the user, you
> can't easily use a variable to decide the target (this was added around
> SB 2001). You would have to modify the code to use an IF block for the
> SELECT portion of each report.
>
> Ciao, Neil
|