DECLARE-IMAGE

Function

Declares the type, size, and source of an image to print.

Syntax

DECLARE-IMAGE image_name
[TYPE=image_type_lit]
[IMAGE-SIZE=(width_num_lit,height_num_lit)]
[SOURCE=file_name_lit]
[[FOR-PRINTER=({POSTSCRIPT|HPLASERJET|HTML|PDF|WINDOWS |PS|HP|HT|PD|WP},image_type_lit,file_name_lit) . . .]
END-DECLARE

Note:

DECLARE-IMAGE and PRINT-IMAGE work together to identify information about the image. The IMAGE-SIZE argument is required and must be defined in either DECLARE-IMAGE or PRINT‑IMAGE. The SOURCE and TYPE arguments are optional; however, if you define one you must define the other.

Arguments

image_name

Unique name for referencing the image declaration.

TYPE

Image type. Types can be EPS-FILE, HPGL-FILE, GIF-FILE, JPEG-FILE, BMP-FILE, PNG-FILE, or AUTO-DETECT.

IMAGE-SIZE

Width and height of the image in Production Reporting coordinates.

SOURCE

Name of a file containing the image. The file must be in the SQRDIR directory, or you must specify the full path.

FOR-PRINTER

Separate image file for each report output type.

Tip:

The TYPE and SOURCE arguments contain the default values. You can override these defaults for a specific printer by using the FOR-PRINTER argument.

Note:

If the file is not in the SQRDIR directory, the full path or no path should be given. A relative path will not do, because you need to know where you execute the file from.

Description

DECLARE-IMAGE defines and names an image. This image can then be placed in a report at the position specified with PRINT‑IMAGE.

If an image has not been declared, or if the image type is not supported for a particular report output type, or if the image file has incomplete header information, then a box (either shaded for HP printers or with a diagonal line through it for Postscript printers) appears where the image is expected. Table 28 illustrates the valid relationships between image type and report output type.

Table 28. Valid Images Types

 

BMP

EPS

GIF

HPGL

JPEG

PNG

HPLaserJet

   

X

  

HTML

X

X

X

X

X

X

PDF

X

 

X

 

X

X

Postscript

 

X

    

Windows

X

     

Examples

declare-image officer-signature
  type= eps-file
  source= 'off_sherman.eps'
  image-size= (40, 5)
end-declare
declare-image oracle-logo
  type='auto-detect'
  image-size=(40,10)
  source=$BLOB_Column

The following example defines separate image files for different printer types:

begin-setup
  declare-image oracle_logo 
     type=GIF-FILE
     Image-size=(40,10)
     source=oracle.gif
     for-printer=(PS, EPS-FILE, 'oracle.eps')
     for-printer=(HP, HPGL-FILE, 'oracle.hpgl')
  end-declare
end-setup
begin-report
  move 'hyperion.bmp' to $image_src
  print-image oracle_logo (10,15)
     for-printer=(WP, BMP-FILE, $image_src)
end-report

In this example, the image file used for each printer type is:

See Also