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     [SOLVED] select output format of a report in an HTML page

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] select output format of a report in an HTML page
 Login/Join
 
Member
posted
Hi There,
working on an HTML page that display a report, and I need to add an option for the user to download Excel file of the report in their pc's, anyone can give me ideas how it can be done please?

This message has been edited. Last edited by: FP Mod Chuck,


WebFocus App Studio
V8201
 
Posts: 23 | Registered: September 18, 2017Report This Post
Virtuoso
posted Hide Post
Would you want this option AFTER the report is produced or BEFORE ?

BEFORE, have this in your code :
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML Web Document (HTML),HTML>,<Portable Document Format (PDF),PDF>,<Excel,XLSX>).Select type of display output.

This gives option to output in HTML, Excel or PDF

AFTER, have this in your code but you will need to have ALL parameters properly sent and note that I call back the same fex that have originally produce the report : it call itself.
This is one option where the save Excel option is placed in the Header (could be almost anywhere)
-IF &WFFMT NE 'HTML' OR 'PDF' THEN GOTO :NODRILL;
TYPE=HEADING,
     LINE=5,
     OBJECT=TEXT, ITEM=1, SIZE=10, JUSTIFY=LEFT, COLOR=RGB(8 97 74),
     FOCEXEC=IBFS:/WFC/Repository/<app>/<SameFExNameAsOriginalOne.fex>( \
     PR1=&PR1.QUOTEDSTRING \
     PR2=&PR2.QUOTEDSTRING \
     PR3=&PR3.QUOTEDSTRING \
     PR4=&PR4.QUOTEDSTRING \
     COMPANYID=&COMPANYID.QUOTEDSTRING \
     WFFMT='XLSX'),
     TARGET='_blank',
$
-:NODRILL


Sample 1
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
BY CAR
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML Web Document (HTML),HTML>,<Portable Document Format (PDF),PDF>,<Excel,XLSX>).Select type of display output.
END


Sample 2
-DEFAULTH &WFFMT = 'HTML'
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
BY CAR
WHERE COUNTRY EQ '&CNTRY';

HEADING
"Save As Excel"

ON TABLE PCHOLD FORMAT &WFFMT

ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
-IF &WFFMT NE 'HTML' OR 'PDF' THEN GOTO :NODRILL;
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT, ITEM=1, SIZE=10, JUSTIFY=LEFT, COLOR=RGB(8 97 74),
     FOCEXEC=IBFS:/WFC/Repository/IT/AAAA.fex( \
     CNTRY=&CNTRY.QUOTEDSTRING \
     WFFMT='XLSX'),
     TARGET='_blank',
$
-:NODRILL
ENDSTYLE
END
-EXIT

This message has been edited. Last edited by: MartinY,


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
It is After the report is produce, I'll try it.

thank you


WebFocus App Studio
V8201
 
Posts: 23 | Registered: September 18, 2017Report This Post
Member
posted Hide Post
I'm trying to make the option of downloading the Excel file after a user select the radio button and select download?
quote:
Originally posted by MartinY:
Would you want this option AFTER the report is produced or BEFORE ?

BEFORE, have this in your code :
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML Web Document (HTML),HTML>,<Portable Document Format (PDF),PDF>,<Excel,XLSX>).Select type of display output.

This gives option to output in HTML, Excel or PDF

AFTER, have this in your code but you will need to have ALL parameters properly sent and note that I call back the same fex that have originally produce the report : it call itself.
This is one option where the save Excel option is placed in the Header (could be almost anywhere)
-IF &WFFMT NE 'HTML' OR 'PDF' THEN GOTO :NODRILL;
TYPE=HEADING,
     LINE=5,
     OBJECT=TEXT, ITEM=1, SIZE=10, JUSTIFY=LEFT, COLOR=RGB(8 97 74),
     FOCEXEC=IBFS:/WFC/Repository/<app>/<SameFExNameAsOriginalOne.fex>( \
     PR1=&PR1.QUOTEDSTRING \
     PR2=&PR2.QUOTEDSTRING \
     PR3=&PR3.QUOTEDSTRING \
     PR4=&PR4.QUOTEDSTRING \
     COMPANYID=&COMPANYID.QUOTEDSTRING \
     WFFMT='XLSX'),
     TARGET='_blank',
$
-:NODRILL


Sample 1
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
BY CAR
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML Web Document (HTML),HTML>,<Portable Document Format (PDF),PDF>,<Excel,XLSX>).Select type of display output.
END


Sample 2
-DEFAULTH &WFFMT = 'HTML'
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
BY CAR
WHERE COUNTRY EQ '&CNTRY';

HEADING
"Save As Excel"

ON TABLE PCHOLD FORMAT &WFFMT

ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
-IF &WFFMT NE 'HTML' OR 'PDF' THEN GOTO :NODRILL;
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT, ITEM=1, SIZE=10, JUSTIFY=LEFT, COLOR=RGB(8 97 74),
     FOCEXEC=IBFS:/WFC/Repository/IT/AAAA.fex( \
     CNTRY=&CNTRY.QUOTEDSTRING \
     WFFMT='XLSX'),
     TARGET='_blank',
$
-:NODRILL
ENDSTYLE
END
-EXIT


WebFocus App Studio
V8201
 
Posts: 23 | Registered: September 18, 2017Report This Post
Virtuoso
posted Hide Post
Badr.A

So do you want the report to display based on the selection from the radio button and then another button to download as Excel?


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Virtuoso
posted Hide Post
Badr,

Using first sample will ask the user to select the output type before producing the report.

Using my second sample will ask the user to first have to select parameter to then produce the report and once the report is produced can click on "Save As Excel" to download the report in Excel.

Not clear what you are asking since my second sample already answered what you've asked
quote:

It is After the report is produce,


quote:

I'm trying to make the option of downloading the Excel file after a user select the radio button and select download?

If you want the user to select from a radio button, it has to be BEFORE the report is produced. radio appears on a HTML page not in the report itself.
The other option would be to have an HTML page with a radio for the output option default to HTML and with an iFrame which display the report after the user have select its parameter and press "Produce Report".
Then if user change the output selection from HTML to Excel an press again "Produce Report", the report will then be executed in Excel in a new window.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
Badr.A,
Here is an example with Excel image used as a drilldown.
Copy code into baseapp/car_report.fex
Copy/Get the image and place into an images folder under applications.

Run it and see if it is what you are looking for...

Tom
-DEFAULT &OUTPUT = 'HTML'
DEFINE FILE CAR
  EXCEL_IMG/A200 = '<IMG SRC=/approot/images/excel.gif border=0 HEIGHT=20 WIDTH=20>';
END
TABLE FILE CAR
HEADING
"Information Builders Car Data"
SUM
   DEALER_COST/P9.2MC AS 'Dealer Cost'
   RETAIL_COST/P9.2MC AS 'Retail Cost'
    COMPUTE PROFIT/P9.2MC = RETAIL_COST - DEALER_COST; AS 'Profit'
  BY COUNTRY AS 'Country'
  BY CAR     AS 'Car'
  BY MODEL   AS 'Model'
 ON TABLE PCHOLD FORMAT &OUTPUT
 ON TABLE SET PAGE-NUM OFF
-*******************
-IF &OUTPUT NE 'HTML' GOTO SKIP_IMAGE;
-*******************
 ON TABLE SET HTMLCSS ON
 ON TABLE SUBHEAD
"<EXCEL_IMG "
-*******************
-SKIP_IMAGE
-*******************
ON TABLE SET STYLE *
 UNITS=IN, GRID=ON, $
TYPE=HEADING, JUSTIFY=CENTER, BACKCOLOR='LIGHT BLUE', COLOR=BLACK, STYLE=BOLD, BORDER=1, $
TYPE=DATA, GRID=ON, BORDER=LIGHT,$
TYPE=TITLE, STYLE=BOLD, BORDER=LIGHT, BACKCOLOR=BLACK, COLOR=WHITE,$
-*******************
-IF &OUTPUT NE 'HTML' GOTO SKIP_DRILL;
-*******************
TYPE=TABHEADING, JUSTIFY=RIGHT,
    FOCEXEC=baseapp/car_report.fex (OUTPUT = 'EXL07'),
	TARGET='_blank',
	ALT='Output to EXCEL',$
-*******************
-SKIP_DRILL
-*******************
ENDSTYLE
END
-EXIT

Excel Image

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report 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     [SOLVED] select output format of a report in an HTML page

Copyright © 1996-2020 Information Builders