Selecting an image from the database Selecting an image URL from the database

4-54 Oracle Reports Users Guide to Building Reports

4.8.5 Selecting an image from the database

To select an image from the database:

1. Create a query that selects a column containing images or the filenames of image

objects.

2. In the Data Model view, double-click the image column to display the Property

Inspector.

3. If the column contains the filenames of image objects, rather than the images

themselves: ■ Under the Column node, set the Read from File property to Yes. 4. In both cases a column containing images or a column containing the filenames of image objects: under the Column node, set the File Format property to Image.

5. If you are developing a JSP-based Web report, you will also need to add the

containsHtml attribute to the rw:field JSP tag for the column, as follows: ■ Display the Web Source view for the report. ■ Search for the rw:field tag for the column rw:field ... src=column_name ... ■ Add the containsHtml=yes attribute to specify that the fields value contains an image. For example: rw:field id=F_MYIMAGE src=MYIMAGE nullValue=nbsp; containsHtml=yes

6. To preview your report output with Web layout in a Web browser, choose

Program Run Web Layout to run the Web Source. If you have made changes to the Web Source view for JSP-based Web reports, this enables you to immediately see the effect of your changes on the output. See also Section 2.4.3, About images Section 1.7.3, About database columns Note: These steps, and the steps in Section 4.9.8.1.2, Linking an image object to a file for paper-based reports only, allow you to include images in a wide variety of formats supported by Oracle Reports, including JPEG all types, such as Progressive JPEG and Exif JPEG, PNG, BMP, TIFF, GIF, and CGM. For paper-based reports, you can also use Insert Image to import an image from a file into the report layout for images in the following formats: TIFF, JFIF, BMP, TGA, PCX, PICT, GIF, CALS, RAS, OIF, PCD see Section 4.9.8.1.1, Importing an image . How To... 4-55

4.8.6 Selecting an image URL from the database

To select a URL from the database that point to an image to include in an HTML report:

1. Create a query, with a SELECT statement that selects a column containing URLs.

2. In the Data Model view, double-click the column containing the URLs to display

the Property Inspector.

3. Under the Column node:

■ Set the Read from File property to Yes. ■ Set the File Format property to Image URL.

4. If you are developing a JSP-based Web report, you will also need to add the

containsHtml attribute to the rw:field JSP tag for the column, as follows: ■ Display the Web Source view for the report. ■ Search for the rw:field tag for the column rw:field ... src=column_name ... ■ Add the containsHtml=yes attribute to specify that the fields value contains an image. For example: rw:field id=F_MYIMAGE src=MYIMAGE nullValue=nbsp; containsHtml=yes

5. To preview your report output with Web layout in a Web browser, choose

Program Run Web Layout to run the Web Source. If you have made changes to the Web Source view for JSP-based Web reports, this enables you to immediately see the effect of your changes on the output. See also Section 2.4.3, About images Section 2.8.8, About HTML and HTMLCSS output

4.8.7 Creating a break group