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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable output option Offline Print v. Browser

Status
Not open for further replies.

sgcons

Programmer
May 15, 2002
2
US
I am trying to give my users the choice of running a report to a Mainframe printer (using OFFLINE PRINT) or viewing the report in the browser as a PDF file.

I included a runtime &variable called &OUTPUT. If the user enters anything in the input box, the report should be directed to an allocated PDS. Here is sample code:

-IF '&OUTPUT'.EXIST THEN GOTO LABEL1 ELSE GOTO LABEL2;
-LABEL1
OFFLINE CLOSE
-* define output PDS
DYNAM ALLOC F OFFLINE DA DEV.BCMSUMMA.DWLK SHR REU
-RUN
-LABEL2

I have similar code at the end of the report
-IF '&OUTPUT'.EXIST THEN GOTO LABEL3 ELSE GOTO LABEL4;
-LABEL4
ON TABLE PCHOLD FORMAT PDF.
-GOTO LABEL5
-LABEL3
OFFLINE CLOSE
-LABEL5

The problem I am having is checking &OUTPUT for a specific condition and having the branching logic go to the right place in the report.

Has anyone done something similar to this? Any and all help will be appreciated.

 
Why not use a radio buttons, instead. That way, the user can EITHER check PDF or OFFLINE, and you can set one of them as the default. The HTML looks like:

<INPUT TYPE=&quot;RADIO&quot; NAME=&quot;variable&quot; [CHECKED] VALUE=&quot;value&quot;>text

for each button

where:

&quot;variable&quot; is the D.M. variable (in your case, OUTPUT)- use the same value for each of the button choices

CHECKED is included for the value to be the default

&quot;value&quot; is the value assigned to the variable (in your case, PDF and OFFLINE)

and text is the text label of the radio button
With this method, you just check for the VALUE of &OUTPUT, which will always exist, and branch accordingly.

 
Thanks for the idea. This customer is not yet publishing their reports. They are running them from MRE and/or ReportCaster.
 
I use the technique described and also provide a selection for excel... boy the users love this option!! Laura
lg@bluebirdsystems.com or
wildpetals@wildpetals.com
 
from MRE, there is an option on the Reporting objects template... you can also put a HTML page in front of any standard reports in MRE that allow them to select their output destinaiton on the fly.

Laura Laura
lg@bluebirdsystems.com or
wildpetals@wildpetals.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top