Generating HTML Output

This chapter describes the procedures that enable SQR for PeopleSoft to generate HTML output. You can publish the output on an internet, intranet, or extranet website. An SQR program without HTML procedures has limited HTML capabilities; therefore, adding HTML procedures to an SQR program enhances the appearance of the HTML output.

This chapter discusses:

See Also

Generating and Publishing HTML from an SQR Program

Click to jump to parent topicHTML General Purpose Procedures

The following table describes HTML general purpose procedures:

Procedure

Description

html_br

Produces the specified number of line breaks in a paragraph by using the HTML<BR> tag. The paragraph continues onto the next line.

Syntax:

html_br(number count, string attributes)

Count: The number of HTML <BR> tags that are inserted.

Attributes: The HTML attributes that are incorporated inside the HTML <BR> tag.

Example:

print 'Here is some text' () do html_br(3,'') print 'Here is some text three lines down' ()

html_center

Marks the start of text to be centered in the HTML document by using the HTML <CENTER> tag. You can also accomplish this by using the SQR print statement with CENTER specified in the code.

Syntax:

html_center()

Attributes: The HTML attributes that are incorporated inside the HTML <CENTER> tag.

Example:

do html_center(‘’) print ‘Here is some centered text’ () do html_center_end

html_center_ end

Marks the end of text that was previously specified as centered.

Syntax:

html_center_end

html_hr

Produces a horizontal divider between sections of text by using the HTML <HR> tag.

Syntax:

html_hr(string attributes)

Attributes: The HTML attributes that are incorporated inside the HTML <HR> tag.

Example:

print 'Here is some text' () do html_hr('') print 'Text after a horizonal divider' ()

html_img

Inserts an image by using the HTML <IMG> tag. You can also do this by using the PRINT-IMAGE command; however, the html_img procedure enables you to specify the full set of available HTML attributes.

Syntax:

html_img(string attributes)

Attributes: The HTML attributes that are incorporated inside the HTML <IMG> tag. Some common attributes include:

  • src: The URL of the image to be inserted.

    Example: src=/images/abc.gif

  • height: The height of the image in pixels.

    Example: height=200

  • width: The width of the image in pixels.

    Example: width=400

Example:

do html_img('src="/images/stop.gif"')

html_nobr

Marks the start of text that cannot be wrapped by using the HTML <NOBR> tag.

Syntax:

html_nobr

Example:

do html_nobr('') print 'Long line of text that shouldn't wrap' ⇒ () do html_nobr_end

html_nobr_end

Marks the end of text that cannot be wrapped by using the HTML </NOBR> tag.

Syntax:

html_nobr_end

html_on

Activates the HTML procedures. Call this procedure at the start of an SQR program; otherwise, the HTML procedures are not activated. After the HTML procedures are activated, format the appearance of the web page by using the various HTML procedures.

Syntax:

html_on

Example:

do html_on

html_p

Marks the start of a new paragraph by using the HTML <P> tag.

Syntax:

html_p(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <P> tag. A common attribute is align = left|right|center, which specifies the alignment of the paragraph.

Example:

do html_p('ALIGN=RIGHT') print 'Right aligned text' (1,1) do html_p_end print 'Normally aligned text' (+1,1)

html_p_end

Marks the end of a paragraph by using the HTML </P> tag. The end of a paragraph is typically implied and the procedure is technically not needed; however, specifying it for completeness is a good practice.

Syntax:

html_p_end

html_set_body_attributes

Specifies the attributes that are incorporated into the HTML <BODY> tag. Call this procedure at the start of the SQR program.

Syntax:

html_set_body_attributes(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <BODY> tag. Some common attributes include:

  • background: Specifies the image to display in the background of the web page.

    Example: background=/images/logo.gif

  • bgcolor=#rrggbb: Specifies the background color of the web page.

    Example: bgcolor=#80FFF

Example:

do html_set_body_attributes('BACKGROUND="⇒ /images/x.gif"')

html_set_head_tags

Specifies the tags that are incorporated between the HTML <HEAD> and </HEAD> tags. These tags are empty by default. One common tag to set is the HTML <TITLE> tag, which specifies the title to display for the web page. Call this procedure at the start of the SQR program.

Syntax:

html_set_head_tags(string attributes)

Attributes: Defines the HTML attributes that are incorporated between the HTML <HEAD> and </HEAD> tags.

Example:

do html_set_head_tags('<TITLE>My Report<⇒ /TITLE>')

Click to jump to parent topicHTML Heading Procedures

The following table describes HTML heading procedures:

Procedure

Description

html_h1

Marks the start of text for heading level one by using the HTML <H1> tag. This heading text appears more prominently than heading level two text.

Syntax:

html_h1(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <H1> tag.

Example:

do html_h1('') print 'This is a heading' () do html_h1_end

html_h1_end

Marks the end of text for heading level one by using the HTML </H1> tag.

Syntax:

html_h1_end

html_h2

Marks the start of text for heading level two by using the HTML <H2> tag. This heading text appears less prominently than heading level one text and more prominently than heading level three text.

Syntax:

html_h2(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <H2> tag.

Example:

do html_h2('') print 'This is a heading' () do html_h2_end

html_h2_end

Marks the end of text for heading level two by using the HTML </H2> tag.

Syntax:

html_h2_end

html_h3

Marks the start of text for heading level three by using the HTML <H3> tag. This heading text appears less prominently than heading level two text and more prominently than heading level four text.

Note. This heading level is the default value.

Syntax:

html_h3(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <H3> tag.

html_h3_end

Marks the end of text for heading level three by using the HTML </H3> tag.

Syntax:

html_h3_end

html_h4

Marks the start of text for heading level four by using the HTML <H4> tag. This heading text appears less prominently than heading level three text and more prominently than heading level five text.

Syntax:

html_h4(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <H4> tag.

html_h4_end

Marks the end of text for heading level four by using the HTML </H4> tag.

Syntax:

html_h4_end

html_h5

Marks the start of text for heading level five by using the HTML <H5> tag. This heading text appears less prominently than heading level four text and more prominently than heading level six text.

Syntax:

html_h5(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <H5> tag.

html_h5_end

Marks the end of text for heading level five by using the HTML </H5> tag.

Syntax:

html_h5_end

html_h6

Marks the start of text for heading level six by using the HTML <H6> tag. This heading text appears less prominently than heading level five text.

Syntax:

html_h6(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <H6> tag.

html_h6_end

Marks the end of text for heading level six by using the HTML </H6> tag.

Syntax:

html_h6_end

Click to jump to parent topicHTML Highlighting Procedures

The following table describes HTML highlighting procedures:

Procedure

Description

html_blink

Marks the start of blinking style text by using the HTML <BLINK> tag.

Syntax:

html_blink(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <BLINK> tag.

Example:

do html_blink('') print 'This is blinking text' () do html_blink_end

html_blink_end

Marks the end of blinking style text by using the HTML </BLINK> tag.

Syntax:

html_blink_end

html_cite

Marks the start of text in citation style by using the HTML <CITE> tag.

Syntax:

html_cite(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <CITE> tag.

Example:

do html_cite('') print 'This is a citation' () do html_cite_end

html_cite_end

Marks the end of text in citation style by using the HTML </CITE> tag.

Syntax:

html_cite_end

html_code

Marks the start of text in code style by using the HTML <CODE> tag.

Syntax:

html_code(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <CODE> tag.

Example:

do html_code('') print 'Here is code style text' () do html_code_end

html_code_end

Marks the end of text in code style by using the HTML </CODE> tag.

Syntax:

html_code_end

html_kbd

Marks the start of text in keyboard input style by using the HTML <KBD> tag.

Syntax:

html_kbd(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <KBD> tag.

Example:

do html_kbd('') print 'Here is keyboard style text' () do html_kbd_end

html_kbd_end

Marks the end of text in keyboard style by using the HTML </KBD> tag.

Syntax:

html_kbd_end

html_samp

Marks the start of text in sample style by using the HTML <SAMP> tag.

Syntax:

html_samp(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <SAMP> tag.

Example:

do html_samp('') print 'Here is sample style text' () do html_samp_end

html_samp_end

Marks the end of text in sample style by using the HTML </SAMP> tag.

Syntax:

html_samp_end

html_strike

Marks the start of text in strikethrough style by using the HTML <STRIKE> tag.

Syntax:

html_strike(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <STRIKE> tag.

Example:

do html_strike('') print 'Here is strikethrough text' () do html_strike_end

html_strike_end

Marks the end of text in strikethrough style by using the HTML </STRIKE> tag.

Syntax:

html_strike_end

html_sub

Marks the start of text in subscript style by using the HTML <SUB> tag.

Syntax:

html_sub(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <SUB> tag.

Example:

print 'Here is' () do html_sub('') print 'subscript text' () do html_sub_end

html_sub_end

Marks the end of text in subscript style by using the HTML </SUB> tag.

Syntax:

html_sub_end

html_sup

Marks the start of text in superscript style by using the HTML <SUP> tag.

Syntax:

html_sup(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <SUP> tag.

Example:

print 'Here is' () do html_sup('') print 'superscript text' () do html_sup_end

html_sup_end

Marks the end of text in superscript style by using the HTML </SUP> tag.

Syntax:

html_sup_end

Click to jump to parent topicHTML Hypertext Link Procedures

The following table describes HTML hypertext link procedures:

Procedure

Description

html_a

Marks the start of a hypertext link by using the HTML <A> tag. When the user clicks the area with the hypertext link, the web browser switches to the specified HTML document.

Syntax:

html_a(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <A> tag. At a minimum, you should define the href attribute, which specifies the URL of an HTML document.

Some common attributes include:

  • href: Indicates where the hypertext link points.

    Example: href=home.html

  • name: Indicates an anchor to which a hypertext link can point.

    Example: name=marker1

Example:

The anchor is positioned at the top of the document. The first hypertext link points to the HTML document named otherdoc.html. The second hypertext link points to the anchor named TOP:

do html_a('NAME=TOP') do html_a_end print 'At the top of document' () do html_br(20, '') do html_a('HREF=otherdoc.html') print 'Go to other document' () do html_a_end do html_p('') do html_a('HREF=#TOP') print 'Go to top of document' () do html_a_end

html_a_end

Marks the end of a hypertext link by using the HTML </A> tag.

Syntax:

html_a_end

Click to jump to parent topicHTML List Procedures

The following table describes HTML list procedures:

Procedure

Description

html_dd

Marks the start of a definition in a definition list by using the HTML <DD> tag.

Syntax:

html_dd(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <DD> tag.

html_dd_end

Marks the end of a definition in a definition list by using the HTML </DD> tag. The end of a definition in a definition list is typically implied and not needed; however, specifying it for completeness is a good practice.

Syntax:

html_dd_end

html_dir

Marks the start of a directory list by using the HTML <DIR> tag.

Syntax:

html_dir(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <DIR> tag.

Example:

do html_dir('') do html_li('') print 'First item' () do html_li('') print 'Second item' () do html_li('') print 'Last item' () do html_dir_end

html_dir_end

Marks the end of a directory list by using the HTML </DIR> tag.

Syntax:

html_dir_end

html_dl

Marks the start of a definition list by using the HTML <DL> tag. A definition list displays a list of terms and definitions. The term appears before and to the left of the definition. Use the html_dt procedure to display a term. Use the html_dd procedure to display a definition.

Syntax:

html_dl(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <DL> tag.

Example:

do html_dl('') do html_dt('') print 'A Daisy' () do html_dd('') print 'A sweet and innocent flower.' () do html_dt('') print 'A Rose' () do html_dd('') print 'A very passionate flower.' () do html_dl_end

html_dl_end

Marks the end of a definition list by using the HTML </DL> tag.

Syntax:

html_dl_end

html_dt

Marks the start of a term in a definition list by using the HTML <DT> tag.

Syntax:

html_dt(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <DT> tag.

html_dt_end

Marks the end of a term in a definition list by using the HTML </DT> tag.

Syntax:

html_dt_end

html_li

Marks the start of a list item by using the HTML <LI> tag.

Syntax:

html_li(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <LI> tag.

html_li_end

Marks the end of a list item by using the HTML </LI> tag. The end of a list item is typically implied and not needed; however, you should specify it for completeness.

Syntax:

html_li_end

html_menu

Marks the start of a menu by using the HTML <MENU> tag. Use the html_li procedure to identify each item in a list.

Syntax:

html_menu(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <MENU> tag.

Example:

do html_menu('') do html_li('') print 'First item' () do html_li('') print 'Second item' () do html_li('') print 'Last item' () do html_menu_end

html_menu_end

Marks the end of a menu by using the HTML </MENU> tag.

Syntax:

html_menu_end

html_ol

Marks the start of an ordered list by using the HTML <OL> tag. Each item in the list typically appears indented to the right with a number to the left. Use the html_li procedure to identify each item in a list.

Syntax:

html_ol(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <OL> tag.

Example:

do html_ol('') do html_li('') print 'First item' () do html_li('') print 'Second item' () do html_li('') print 'Last item' () do html_ol_end

html_ol_end

Marks the end of an ordered list by using the HTML </OL> tag.

Syntax:

html_ol_end

html_ul

Marks the start of an unordered list by using the HTML <UL> tag. Each item in the list typically appears indented to the right with a bullet to the left. Use the html_li procedure to identify each item in a list.

Syntax:

html_ul(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <UL> tag.

Example:

do html_ul('') do html_li('') print 'First item' () do html_li('') print 'Second item' () do html_li('') print 'Last item' () do html_ul_end

html_ul_end

Marks the end of an unordered list by using the HTML </UL> tag.

Syntax:

html_ul_end

Click to jump to parent topicHTML Table Procedures

The following table describes HTML table procedures:

Procedure

Description

html_caption

Marks the start of a table caption by using the HTML <CAPTION> tag.

Syntax:

html_caption(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <CAPTION> tag.

html_caption_end

Marks the end of a table caption by using the HTML </CAPTION> tag. The end of a table caption is typically implied and not needed; however, you should specify it for completeness.

Syntax:

html_caption_end

html_table

Marks the start of a table by using the HTML <TABLE> tag.

Syntax:

html_table(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <TABLE> tag.

Some common attributes include:

  • border: Specifies that a border appears around each cell of a table.

  • width: Specifies the width of an entire table in pixels.

  • cols: Specifies the number of columns in a table.

    Example: COLS=4

Example: Displaying database records in a tabular format. The html_caption_end, html_tr_end, html_td_end, and html_th_end procedures are used for completeness; however, they are typically implied and not needed.

! start the table & display the column headings do html_table('border') do html_caption('') print 'Customer Records' (1,1) do html_caption_end do html_tr('') do html_th('') print 'Cust No' (+1,1) do html_th_end do html_th('') print 'Name" (,10) do html_th_end do html_tr_end ! display each record begin-select do html_tr('') do html_td('') cust_num (1,1,6) edit 099999 do html_td_end do html_td('') name (1,10,25) do html_td_end do html_tr_end next-listing skiplines=1 need=1 from customers end-select ! end the table do html_table_end

html_table_end

Marks the end of a table by using the HTML </TABLE> tag.

Syntax:

html_table_end

html_td

Marks the start of a new column in a table row by using the HTML <TD> tag. This tag specifies that the text that follows appears in the column.

Syntax:

html_td(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <TD> tag.

html_td_end

Marks the end of a column in a table by using the HTML </TD> tag. The end of a column is typically implied and not needed; however, you should specify it for completeness.

Syntax:

html_td_end

html_th

Marks the start of a new column header in a table row by using the HTML <TH> tag. This tag specifies that the text that follows appears as the header of the column.

Syntax:

html_th(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <TH> tag.

html_th_end

Marks the end of a column header in a table by using the HTML </TH> tag. The end of a column header is typically implied and not needed; however, you should specify it for completeness.

Syntax:

html_th_end

html_tr

Marks the start of a new row in a table by using the HTML <TR> tag.

Syntax:

html_tr(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <TR> tag.

html_tr_end

Marks the end of a row by using the HTML </TR> tag. The end of a row in a table is typically implied and not needed; however, you should specify it for completeness.

Syntax:

html_tr_end