HTML Procedures PDF Print E-mail
Written by David Vandiver   
Wednesday, 14 July 2010 02:46

SQR provides a built in feature for producing HTML files.  In the command line, you can specify -printer:ht to have your output produce an HTML file (instead of PDF or LIS).  This entry in the tricks and tips will attempt to shed some light on these HTML procedures.

Command Line

There are two types of HTML; Standard and Enhanced.  If you specify -printer:ht on the command line, you will have output in version 2.0 HTML (standard).  If you specify -printer:eh, you will get enhanced HTML (version 1.1 XHTML).  The Enhanced is produced by an external Java process.  You will probably finde your output for both standard and enhanced will look the same.  This is because you are running in Enhanced for both printer settings.  Read the next paragraph to understand why.

In SQR 11.1, I found the following in the Developer's Guide.  By default, specifying "ht" as the printer on the command line will produce an enhanced version.  The only way to override this is to specify the following in the SQR.ini file.  In the DEFAULTS section, add the following:

PrinterHT=Standard

So unless you have the setting for Standard in the SQR.ini, all HT And ET printers will produce an enhanced HTML formatted page.

One of the major items on the Standard HTML layout is that positions are ignored; each print statement follows the next.  You will have to add breaks and tables elements to have the output look organized.  Oracle provides an include file to assist, called HTML.inc.

HTML.inc

As far back as 1994, and as recent as SQR 11.1, one of the include files delivered with SQR is called HTML.inc.  There are instructions in the SQR 11.1 Developer's Guide (volume 1, chapter 32, and volume 2, chapter 4).  I will attempt over the next few weeks to add how to make these work.

The main need for this include file is if you are running standard HTML (having -printer:ht on the command line AND having PrinterHT=Standard in the SQR.ini file).  There are procedures such as html_on and html_set_head_tags.  One area I found was that some of these procedures only work for standard HTML, not enhanced.  For example, procedure html_set_head_tags will only work for Standard.  On Enhanced, the words %%HEADTAGS= will appear on the HTML page.

Below are the HTML procedures that can only be used for Standard:

  • html_on
  • html_set_head_tags
  • html_set_body_attributes

Example for Standard HTML:

#include 'html.inc'
begin-program
do html_on
do html_set_head_tags('My Report')
print 'Test1' (+1, 1)
do html_br(2,'')
print 'Test2' (+1, 1)
end-program

 

Last Updated on Wednesday, 14 July 2010 03:56
 
Follow us on Twitter
RocketTheme Joomla Templates