Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Technique for Lee from Mickey Grackin (HTML & PDF)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Technique for Lee from Mickey Grackin (HTML & PDF)
 Login/Join
 
Virtuoso
posted
I realize the following may already be somewhere on Focal Point but I promised Lee I would post this code after Summit. Please let me know if you have any questions.

This is a technique that creates both an HTML and PDF output and HOLDs the PDF output on the WebFOCUS Client Temp Directory for a limited time so that it may be retrieved without rerunning the report. This presents the HTML output format to the user with a 'Printer Friendly' hyperlink to the PDF file.

WebFOCUS has a temporary directory which it uses to store files for a limited time. This directory is stored in the &CGI_TEMP_DIR WebFOCUS Client variable. The _TempFileTimeout setting controls how long files remain in this directory.

This technique takes advantage of the automatic cleanup of temporary files in order to make sure the PDF report files do not stay around forever. This technique assumes the WebFOCUS Client and WebFOCUS Server are installed on the same machine.

Step 1
Add a virtual directory called "ibi_temp" to the Web Server that points to the &CGI_TEMP_DIR. At my site we are using Microsoft IIS as teh Web Server.

Step 2
Add the following code to the SITE.WFS file in the WebFOCUS Client. This can be done by accessing the WebFOCUS Client Administration Panel and accessing Custom Settings under Configuration. This will setup a variable on the WebFOCUS Server (&IBITMP) to be used by the FOCEXEC to HOLD the PDF file output.

IBITMP=&CGI_TEMP_DIR
<set>IBITMP(pass)

Step 3
Create a FOCEXEC containing the following code that is accessible in the WebFOCUS Server APP PATH.

-*******************************************************************************
-* The following section should contain code that extracts the data needed for
-* the final output of the report.
-*******************************************************************************
TABLE FILE CAR
PRINT RETAIL_COST DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
ON TABLE HOLD AS 'JUSTDATA'
END
-RUN
-*******************************************************************************
-* The following creates a random file name for the PDF file using the time of
-* day and a random number. This can be enhanced to use userid in the filename.
-*******************************************************************************
-SET &RANDOMNUM=ABS(RDUNIF('D9.7'))*1000000;
-SET &TIMEOFDAY=STRIP(8,&TOD,'.','A6');
-SET &PDFFILENAME=&TIMEOFDAY | (&RANDOMNUM || '.pdf');
-*******************************************************************************
-* The following adds the WebFOCUS TEMP directory to the APP PATH as PDFHOLD and
-* then does a FILEDEF to force the PDF HOLD file to be saved in PDFHOLD.
-*******************************************************************************
APP MAP PDFHOLD &IBITMP
APP FI PDF_FILE DISK PDFHOLD/&PDFFILENAME
-RUN
-*******************************************************************************
-* The following section creates the PDF file.
-*******************************************************************************
TABLE FILE JUSTDATA
PRINT RETAIL_COST DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOPAGE
ON TABLE HOLD AS 'PDF_FILE' FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, ORIENTATION=LANDSCAPE, SQUEEZE=ON,$
TYPE=TITLE, BORDER=LIGHT, BACKCOLOR=NAVY, COLOR=WHITE,$
TYPE=DATA, BORDER=LIGHT,$
ENDSTYLE
END
-RUN
-*******************************************************************************
-* The following section creates the HTML output with a link to the PDF file in
-* the HEADING of the HTML output.
-*******************************************************************************
TABLE FILE JUSTDATA
PRINT RETAIL_COST DEALER_COST
COMPUTE PDFVERSION/A75='<A HREF=/ibi_temp/&PDFFILENAME..>Printer Friendly Version</A>'; NOPRINT
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
HEADING
"<PDFVERSION"
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOPAGE
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE=TITLE, BORDER=LIGHT, BACKCOLOR=NAVY, COLOR=WHITE,$
TYPE=DATA, BORDER=LIGHT,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Technique for Lee from Mickey Grackin (HTML & PDF)

Copyright © 1996-2020 Information Builders