13.2 Configuring and Using Text PDS

Text PDS is configured and available out-of-the-box for Oracle Reports.

13.2.1 Text Configuration File

The textpds.conf file is the Oracle Reports Text PDS configuration file which can be changed, added, or deleted. The file is located at the following directories:

  • For Reports Server:

    ORACLE_INSTANCE\config\ReportsServerComponent\server_name\textpdf.conf

  • For Oracle Reports Builder:

    ORACLE_INSTANCE\config\ReportsToolsComponent\ReportsTools\textpdf.conf

  • For Reports Application (in-process Reports Server) deployed in Oracle WebLogic Server:
    DOMAIN_HOME/config/fmwconfig/servers/WLS_REPORTS/applications/reports_version/configuration

Example

The following example illustrates the contents of textpds.conf file:

<!--XML section.Please edit this section to give your file format information-->
<textPDS  
    xmlns="http://xmlns.oracle.com/reports/pdstext"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.oracle.com/reports/pdstext file:c:\orawin/reports/dtd/textpds.xsd" 
    >

<!--Data definition for Apache Log file format-->
  <fileFormat  name = "Apache Log File" comment = "#" delimiter = "default"
               type ="variable" nullValue = "-">
    <columnInfo>
<column    name = "Remote Host"      type = "string" />
      <column    name = "Remote Log Name"  type = "string"/>
      <column    name = "Remote User"      type = "string"/>
      <column    name = "time"             type = "date"    cellWrapper = "\[]"
                 pattern = "dd/MMM/yyyy:hh:mm:ss zzz"/>
      <column    name = "Request"          type = "string"  cellWrapper = "&quot;"/>
      <column    name = "status"           type = "number"/>
      <column    name = "bytes"            type = "number"/>
    </columnInfo>
  </fileFormat>

<!--Data definition for Comma Delimited file format-->
 <fileFormat  name = "Example Variable Width Comma Delimited" comment = "#" 
              delimiter = "," type = "variable"> 
     <columnInfo> 
      <column    name = "var_cd_col1"     type = "string" /> 
      <column    name = "var_cd_col2"     type = "string"/> 
      <column    name = "var_cd_col3"     type = "string"/> 
     </columnInfo> 
  </fileFormat>

  <!--Data definition for Fixed Width format-->
  <fileFormat  name = "Example Fixed Width Space Delimited" comment = "#" 
               delimiter = ""  type = "fixed"> 
     <columnInfo> 
      <column    name = "fw_sd_col1"     type = "string" startpos = "1"  width = "13"/>
      <column    name = "fw_sd_col2"     type = "number" startpos = "14" width = "10"/>
      <column    name = "fw_sd_col3"     type = "date"   startpos = "25" width = "10"/>
    </columnInfo> 
 </fileFormat> 
</textPDS>

Table 13-13 outlines the various values that can be associated with a File Formats.

Table 13-13 File Format Attributes

Attribute Name Description

name

A File Format name, this name appears in the Data Definition drop down list

Comment

A Comment character, this will be used in the DataSource.

Delimiter

A Column Delimiter. The Data Source file contains data in rows. Each row has fields or tokens corresponding to the Columns specified in the configuration file. Each field or token will be separated by a Column delimiter (See cellWrapper)

type

A File Format Type which can be either a fixed or variable. In case of variable file format, the column width is variable. In case of fixed file format, the column width is fixed and is specified using the attributes startpos and width for each column.

nullValue

This is a null value character.


Table 13-14 outlines the various values that can be associated with a Column.

Table 13-14 Column Attributes

Attribute Name Description

name

This is the name of the Column Heading

type

This is the Column Data type. There are three data types that are supported:

  • String

  • Number

  • Date

cell Wrapper

This is an optional attribute. If specified, this character will override the File Format delimiter for the column for which it is specified.

pattern

This is an optional attribute. Currently it is used only for date fields. It specifies the pattern in which date field is to be expected.