A script-enabled browser is required for this page to function properly.

Read from File property

The Read from File property specifies if the information in the column is retrieved from a database or referenced from a file. Read from File is useful if you have image, graphic, or text files that are referenced by a column. You can use Read from File with database, summary, formula, or placeholder columns (assuming that the column's values are filenames). You can also include files in your report as boilerplate.

Applies to

Columns

Values

Yes

The contents of the files will be imported and used as the values of the column. Indicates that the column contains the names of files or a URL for an image. You must also specify the format of the files in the File Format property.

No

The column will get its values from the database.

Default

No

Required/Optional

Optional

Restrictions

Usage notes

Examples

Example 1:   Image

Suppose that for each of your employees you have a .bmp file that contains a picture of the employee. In your employee table, you have a column named PICTURE that contains the name of the .bmp file with the employee's picture.

To generate a report that displays the employees' pictures, you select the PICTURE column in your query. In the Column properties for the PICTURE column, you set Read from File to Yes and specify Image as the File Format. Reports Builder will display the files pointed to by the PICTURE column wherever you have referenced the PICTURE column in your layout.

Note: If Read from File is set to No, the filenames will be printed instead of the pictures.

Example 2: Formula column

Suppose that you want to create an employee listing with some text from a file next to each employee's information. If the employee's salary is greater than $2000 you want text from a file called salary1.txt to appear next to the employee. If the employee's salary is less than $2000 you want the text from a file called salary2.txt to appear next to the employee.

You create a formula column with a Datatype of Character and Read from File set to Yes (with a File Format of Text). In the Formula field for the column, you enter the following PL/SQL:

if :sal > 2000 then
  return('/home/jsmith/txt/salary1.txt');
else
  return('/home/jsmith/txt/salary2.txt');
end if;

See also

Linking a text object to a file

Linking an HTML object to a file

Linking an image object to a file