Since you can’t embed HTML tags in the text you’re printing (just use the regular OIPI messages for bold, italic, etc), how can you print graphics or other ‘Raw’ data in a file that you’re exporting to? There’s another OIPI message called EXPORTDATA that will let you put data, such as a graphic, into an HTML Document. Remember, when testing this program, that some browsers don’t display bitmap files correctly.

Here's an example of a subroutine to insert a graphic into an HTML file using this message.

Subroutine OIPI_ExportData_Example(Parent)
/*
This program is proprietary and is not to be used by or disclosed to
others, nor is it to be copied without written permission from Revelation Technologies, Inc.
VERSION : OI 3.7.5
PURPOSE : An example program to show how to add a graphic to an existing HTML file
AUTHOR : Mike Ruane
CREATED : October, 2001
PROCEDURES : This module may be called either as a stored procedure or as an internal
subroutine.
WARNINGS :
THEORY OF OPERATION :
Add a graphic to an already existing HTML file.
REVISION HISTORY (Most CURRENT first) :
DATE IMPLEMENTOR FUNCTION
-------- ----------- --------
MM-DD-YY initials Modification
---------------------------------------------------------------------------*/
Declare Function Set_Printer, Get_Printer, Msg
Filename ='HTML Test ':@FM: '':@FM: 2 :@FM: 'C:\temp\EXPORTDATA.HTML'
x = Set_Printer("INIT",FILENAME,'','','',5:@VM:@VM:1)
stat = Set_Printer("TEXT", "This is an HTML test.")
pos = Get_Printer("POS")
y = pos<2>
Bitmap = 'oilogon.bmp'
stat = Set_Printer("BMP", Bitmap, 0:@FM:y)
*---
* the following command supposes that the image is relative to the webserver!
*---
stat = Set_Printer("EXPORTDATA", '<IMG SRC="/OILOGON.BMP">')
stat = Set_Printer("TERM", 1) ;* End printing
x = msg(Parent, 'Process has completed')
return 0
The resulting HTML file displays in Internet Explorer 6 as shown below:

  • No labels