Using Web Display Format: HTML
You can display a report as an HTML page. HTML supports most style sheet options (especially when used with an internal cascading style sheet), allowing for full report formatting.
By default, leading and internal blanks are compressed on the report output. For information on preserving them, see Preserving Leading and Internal Blanks in Report Output.
For more information, see Controlling Report Formatting.
HTML is the default display format when WebFOCUS is installed. An HTML report opens in your web browser.
If you do not wish to rely on the default, you can specify that a report display as an HTML page when you run the report. You can use either:
- PCHOLD command. For more information, see Choose a Display Format Using PCHOLD.
- ONLINE-FMT parameter of the SET command. For more information, see Choose a Display Format Using SET ONLINE-FMT.
HTML display format requires that the SET command's STYLESHEET parameter be set to any value except OFF. Appropriate values include ON (the default), the name of a StyleSheet file, or an inline StyleSheet (*).
Reporting and formatting options that are supported for HTML are described and illustrated extensively throughout the WebFOCUS language documentation.
You can additionally customize the display of HTML reports with any JavaScript or VBScript function using the JSURL SET parameter. For details, see the ibi™ WebFOCUS® Developing Reporting Applications manual.
Customizing the Display of an HTML Report
The following example illustrates how you can customize the display of an HTML report by calling your own JavaScript function in addition to the WebFOCUS default JavaScript functions. Use the JSURL SET parameter to accomplish this.
The JavaScript function shown here disables the right-click menu when you run a report.
- Create a js file
and save it in a location accessible by the web server.
For example, the following disables the right-click menu in an HTML report:
function setnocontextclick () { if (document.body != null) { document.body.oncontextmenu=new Function("return false"); } else window.setTimeout("setnocontextclick()",100); } function killmenuOnLoadFunc(arrayofonloads,currentindex) { setnocontextclick(); }
This file is saved as killmenu.js in the ibi_apps/ibi_html directory.
Note: The onload function must be named in the format.customfunctionnameOnLoadFunc
where:
customfunctionnameIs the name of the JavaScript file that contains the function code. - Add the JSURL parameter to your TABLE request. You can add the command to the edasprof.prf file if you want the js file to run with every HTML report that is run on that server.
- Run the report.
SET JSURL=/ibi_apps/ibi_html/killmenu.js TABLE FILE CENTORD SUM QUANTITY BY PLANTLNG END
The right-click menu option is not available in the report output.
Disabling Default ibi WebFOCUS JavaScript Functions
You can disable or modify default WebFOCUS JavaScript functions using the JSURL SET parameter. The following example illustrates how all WebFOCUS default functions can be displayed in an alert box and disabled.
- Create a js file
and save it in a location accessible by the web server.
This file is saved as disable.js in the ibi_apps/ibi_html directory. The arrayofonloads array consists of two string parameters, str1 and str2. str1 is the name of the function to call on load. str2 is a Boolean (true/false) that indicates whether or not to perform the action described by str1. The currentindex parameter is a sequence number that defines the order in which the function is loaded when the page is displayed.
function disableOnLoadFunc(arrayofonloads,currentindex) { buffer =""; for (var index=0;index<arrayofonloads.length;index++) { buffer += arrayofonloads[index].str1+"\n" ; arrayofonloads[index].str2=false; } alert(buffer); }
- Add the JSURL parameter to your TABLE request.
- Run the report.
-OLAP ON SET AUTODRILL = ON SET JSURL=/ibi_apps/ibi_html/disable.js TABLE FILE CENTORD SUM QUANTITY BY PLANTLNG END
The output looks like this:
Usage Notes for HTML Report Output
- The default behavior for HTML format when borders are turned on is to display column titles without the underline. To display column titles with underlines when borders are on, set GRID OFF.
- The AUTOFIT parameter automatically resizes the HTML report output
to fit the container (window or frame). For procedures that contain
multiple report output, if AUTOFIT is set to ON in any of the report
output procedures, the setting will apply to all report output on
the page.
AUTOFIT is supported using the Accordion, On Demand Paging, HTML TOC, and HFREEZE interactive reporting features.
For more information on the AUTOFIT parameter, see the ibi™ WebFOCUS® Developing Reporting Applications manual.
Creating HTML Reports With Absolute Positioning
Format DHTML provides HTML output that has most of the features normally associated with output formatted for printing such as PDF or PostScript output. You can create an HTML file (.htm) or a Web Archive file (.mht). The type of output file produced is controlled by the value of the HTMLARCHIVE parameter.
Some of the features supported by format DHTML are:
- Absolute positioning. DHTML precisely places text and images inside an HTML report, allowing you to use the same StyleSheet syntax to lay out HTML as you use for PDF or PS output.
- On demand paging. On demand paging is available with SET HTMLARCHIVE=OFF.
- PDF StyleSheet features. For example, the following features are supported: grids, background colors, OVER.
Create Web Archive Report Output
SET HTMLARCHIVE = {ON|OFF}
where:
Creates output in Web Archive format. The file type of the output file is MHT.
Creates output in HTML format. The file type of the output file is HTM. OFF is the default value.
Create a DHTML Report
[ON TABLE] HOLD [AS name] FORMAT DHTML
where:
Specifies the name of the output file. The extension will be HTML if SET HTMLARCHIVE is OFF or MHT if SET HTMLARCHIVE is ON.
Usage Notes for Format DHTML
- The font map file for DHTML reports is member DHTML in the ERRORS data set.
- Legacy compound reports are not supported.
Creating a DHTML Report
The following example creates a DHTML file that has an image with absolute positioning:
SET HTMLARCHIVE = OFF TABLE FILE GGSALES SUM UNITS BY CATEGORY BY PRODUCT ON TABLE SUBHEAD "Report on Units Sold" " " " " " " " " " " ON TABLE SET PAGE-NUM OFF ON TABLE HOLD FORMAT DHTML ON TABLE SET STYLE * TYPE=TABHEADING,IMAGE=c:\images\GOTHAM.GIF, POSITION=(.25 .25), SIZE=(.5 .5), $ ENDSTYLE END
The output shows that the look and positioning are the same as they would be for a PDF report: