Tuesday, December 28, 2010

HTML Procedures in SQR

Creating HTML output from SQR

To use the HTML procedures listed below, your program must reference the HTML procedures.
Issue the following two commands at the start of your program:

#include html.inc
do html_on

The file html.inc is located in the SAMPLE (or SAMPLEW) directory. Use the command-line flag -I to indicate this location.

There are 6 types of HTML procedure that can be used to easily create HTML o/p files.

General Purpose Procedures
Heading Procedures
Highlighting Procedures
Hypertext Link Procedures
List Procedures
Table Procedures

Eg:-
1) Html_br

Produces the specified number of line breaks in a paragraph using the HTML "BR" tag.
This causes the paragraph to be continued 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: Producing a line break:
Print 'Here is some text' ()
Do html_br (3,'')
Print 'Here is some three lines down' ()

2) Inserts an image using the HTML "IMG" tag. This can also be done using the command PRINT-IMAGE;
However, the procedure html_img provides the ability 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:

Src = URL of the image to be inserted (Ex: src=/images/abc.gif)
Height = height of the image in pixels (Ex: height=200)
Width = width of the image in pixels (Ex: width=400)

Example: Producing an image:

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

2 comments:

  1. In addition, must set the printer for HTML: -printer:ht. For more reference: http://www.ontko.com/sqr/sqrcard8.html

    ReplyDelete
  2. Hi Kunnu,


    I am tring to print an image in an sqr .I want my output of the report in PDF. How do I access the image from web which is in http://abcdev/logo.jpg in an SQR and print it. Do you have any Example. can you please share you thoughts on this.
    Thanks
    S

    ReplyDelete