Document ID:        28399.1
Subject:            (V25)DESIGNING CHARACTER-MODE REPORTS IN ORACLE REPORTS 2.5
Author:             BPATEL
Last Revision Date: 21 January   1997


          Designing Character-Mode Reports in Oracle Reports 2.5
          ======================================================

One of the most commonly asked questions is how to design a
character-mode report to produce ASCII Text output in Oracle Reports,
which you can then easily merge into third-party spreadsheet,
database, or word-processing applications or can move across
platforms.  This bulletin outlines the steps to produce ASCII output
from Oracle Reports 2.5.x versions, specifically on Microsoft Windows
platforms (3.1/3.11/NT/95).  For producing ASCII Text output from
Oracle Reports on the Macintosh platform, please refer to the
following bulletin:
BUL 108082.256  APPLE: CALLING REPORTS TEXT RUNTIME FROM FORMS

For information on how to design character-mode reports in Oracle Reports 2.0,
please refer to the following bulletin:
BUL 11750787.61 DESIGNING CHARACTER-MODE REPORTS IN ORACLE REPORTS 2.0

Oracle Reports 2.5 on Microsoft Windows
---------------------------------------
APPLIES TO Version 2.5.5.2.5 (Developer 2000 Release 1.3.2), and
           Version 2.5.4.0.8 (Developer 2000 Release 1.2)

To ensure clean ASCII output, design the Character-Mode report as follows:

1a. Start the Oracle Reports 2.5 Designer.
 b. Connect to the database.
 c. Create a new report by entering the SQL select statement
    in the Data Model screen.

2a. In the Object Navigator, select the desired report.
 b. Double-click or select Tools->Properties
    to invoke the Report Properties.
 c. Click on the Character Mode tab.
 d. Make sure the 'Use Character units in Designer' option is checked.
    This option specifies that the Layout Editor and its grid uses
    Character Cell units, as opposed to bitmap units.
 e. Enter the desired Report Width X Height settings.
    This specifies the page dimensions for the report in character units.
    Standard settings include 80 X 66, 132 X 66, and 180 X 66.  You must also
    specify these settings in the .prt file (printer definition file)
    that the DESFORMAT parameter refers to.  This is discussed in step 5 below.

3.  In the Object Navigator:
    a. Click on the + sign next to Data Model.
    b. Click on the + sign next to System Parameters.
    c. Double-click on the MODE parameter.
    d. Change the Initial Value setting from Default to Character.
       This ensures running the report in Character Mode.

4a. Select Tools->Default Layout
 b. Select the desired layout.
 c. Click on the Data/Selection tab.
 d. Examine the field names, field width, and field height.
    Note that a field with width=9, height=1 occupies 9 X 1 = 9 character cells
    in the layout.  Each character cell holds only one character, resulting in
    each character occupying same amount of space in the output; hence, the
    output uses fixed fonts, as opposed to proportional fonts used in
    bitmapped reports.  Note that each object gets mapped exactly to a set of
    character-cells without any overlapping.

5a. In the Object Navigator, double-click the DESFORMAT parameter.
 b. Examine the Initial Value entry.  The default value is 'dflt',
    which actually refers to a printer definition file 'dflt.prt'
    that is located in c:\orawin\report25\printers directory.  Take time to
    study dflt.prt and the other *.prt files provided: you sometimes need to
    make changes to the .prt file to achieve the desired output.
    Printer Definition Files allow you to specify escape sequences for the
    printer (e.g. to print Landscape, bold, or compressed fonts).
 c. The Character-Mode report is now ready to run.
    1.  Save the report to filesystem (.rdf file) or database tables.
    2.  Select File->Run to the run the report.
        You can run the report from .rdf or .rep files.
        Depending on the Destination Type (DESTYPE) value, the following
        report output generates:

        Screen :  ASCII Text output is displayed on the screen.
        Preview:  same as in 'Screen'
        File   :  sends ASCII Text output to a file named 'filename.lis' or
                  the name specified in Destination Name (DESNAME).
        Printer:  sends ASCII Text output to the 'default' printer,
                  as specified in the Control Panel.
        Mail:     sends ASCII Text output to the mail-id.

6.  Fonts in Character-Mode Reports:
    Font type, size, or style does not hold any meaning in ASCII Text
    output.  In the Layout Editor, you can use the Format->Font option to
    alter the font for a field to be 'Courier New, size 8, Bold, Italic,
    Underline'.  You can see this altered font in the Layout Editor, and,
    to some extent, in Preview after running the report.  Because you are
    using a bitmapped application, Layout Editor and Previewer are viewed
    in GUI or bitmapped environments; however, the resulting output in a
    File or on the Printer always uses the plain font of a fixed size
    font, generally Fixedsys, size 10.  You can format the output on the
    printer by adding appropriate escape sequences in the printer
    definition (.prt) file as specified by the DESFORMAT parameter.
    Check your printer settings and/or consult your printer manual for more
    information.

7.  Printing Landscape:
    Character-Mode reports ignore the ORIENTATION parameter.  By default,
    all Character-Mode reports print in Portrait format.  To print Landscape:
    a. Specify the desired Width X Height settings (e.g. 132 X 66, 180 X 66)
       in the .prt file and on the Character-Mode tab of Reports Properties.
    b. Insert the desired escape sequences in the printer definition (.prt)
       file as specified by the DESFORMAT parameter.  Check the printer
       settings, and/or consult your printer manual for more information.

Oracle Reports Version 2.5 (PRIOR TO 2.5.4.0.8)
-----------------------------------------------
Oracle strongly advises you to upgrade to the latest version available
(V2.5.5.2.5 as of 12/16/96).

In the earlier releases of Oracle Reports 2.5, generation of ASCII
Text output from Character-Mode Reports was made possible through
"Oracle Reports ASCII Driver", which was configured automatically in
the Control Panel during installation.  This printer driver is actually
the ORAW.DRV file installed in the C:\WINDOWS\SYSTEM directory.
This driver was developed to overcome the problems associated with the
'Generic / Text only Driver' included with Microsoft Windows.

Note: Since the release of Reports 2.5.4, Developer/2000 has the
      capability to directly generate character (ASCII) reports in Microsoft
      Windows 3.x, Windows NT, and Windows 95 environments.  For the
      selected printer, Reports directs ASCII character output to the
      printer port (or to a file if the printer is assigned to a file),
      bypassing the printer driver.  You do not need to use Microsoft's
      'Generic/Text Only' driver or 'Oracle Reports ASCII' driver, which was
      provided as part of previous Reports 2.5 releases.  If you have
      installed previous releases of Reports 2.5, you can use the Windows
      3.x/95/NT Control Panel to remove the Oracle Reports ASCII driver.

Before invoking the Reports Designer, check the following:
In the Windows Control Panel, Printers section, make sure that the
Installed Printers list includes the driver:
      "Oracle Reports ASCII Driver on FILE:"

You can also set this driver to LPT1: to redirect the output directly
to the printer connected to port LPT1.

Warning: Do not set the Oracle Reports ASCII driver as the default
         driver as it is not guaranteed to work with other products.

Follow the same steps 1-5 in the previous section to design a
character-mode report.  At runtime, since MODE=Character, this
automatically invokes 'Oracle Reports ASCII Driver' to format the text
output.  A warning message notifies the user that the Oracle Reports ASCII
driver has been selected to run a character-mode report.

You can open or merge resulting ASCII text file in Microsoft Write
(with or without conversion), Word, Excel, or Access.  You can also
merge it with native file formats.

Common Questions and Answers
----------------------------
Q.  For Oracle Reports versions PRIOR to 2.5.4 only:
    You install Oracle Reports 2.5 on a Netware file Server.
    How do you install the Oracle Reports ASCII driver on clients'
    Windows  environment, other than the one used to install ?

A.  Reports 2.5 includes the 'Oracle Reports ASCII Driver', which is
    installed as part of the product installation.  This is actually the file
    ORAW.DRV installed in \windows\system directory.
    To manually install the driver:
    1. Make sure the file oraw.drv is in the \windows\system directory.
    2. Include the following two lines in the WIN.INI file in
       \windows directory:

       [PrinterPorts]
       ..
       Oracle Reports ASCII Driver=oraw,FILE:,15,45

       [devices]
       ..
       Oracle Reports ASCII Driver=oraw,FILE:

    This automatically selects the Reports ASCII Driver at runtime if
    MODE=Character is set in the report definition or dynamically set at
    runtime.  A message notifies the user that the Reports ASCII driver
    has been selected to run a character mode report.

    Warning: Do not set the Reports ASCII driver as the default driver, nor
    use with any other products, as Oracle cannot guarantee the integrity of
    the driver outside of Reports 2.5.

    Reminder : This applies only to versions PRIOR to V2.5.4.0.8 on the
               Microsoft Windows platform.

Example of a Printer Definition File (test.prt)
-----------------------------------------------

printer "test"

height   66
width    132

before report esc "(s0P" esc "&k2S" esc "&17.27c66F"
landscape esc "&l10"

code "123"      esc "(s7B"
code "456"      esc "(s0B"

after page control(L)

return        control(M)
linefeed      control(J)

code "bold on"         esc "(s7B"
code "bold off"        esc "(s0B"
code "underline on"    esc "&dD"
code "underline off"   esc "&d@"
code "bold underline on"        esc "(s7B" esc "&dD"
code "bold underline off"       esc "(s0B" esc "&d@"

Explanation of Printer Definition FILE (test.prt)
-------------------------------------------------
The above example is for the HP Laserjet IIISi Printers.  The escape
sequences listed are specific to this printer, so these may not work
with other printers.  To use this .prt file, set DESFORMAT to 'test'
inside the report.

(a) To print landscape, include
    landscape esc "&l10"
    after the 'before report' section.

(b) The line
    before report esc "(s0P" esc "&k2S" esc "&17.27c66F"
    puts the print in compressed mode.

(c) To print only one column ENAME in bold:
      - In the Layout Editor, invoke the property sheet for ENAME
      - Click on the Printer Codes tab.  Enter Before: &123, After: &456
      - Reference &123 and &456 in .prt file as shown above,
              code "123"      esc "(s7B"         -- turns bold on
              code "456"      esc "(s0B"         -- turns bold off

(d) The last section shows sample escape sequences for
    HP Laserjet IIISi printer.

(e) Note that printing landscape, compressed, bold, etc., through escape
    sequences only works when you send output to the printer (not to
    other DESTYPEs) because only the printer can understand those sequences.

Oracle Reports 2.5 on UNIX and Other Server Platforms
------------------------------------------------------
APPLIES TO ALL 2.5 VERSIONS ON UNIX

Designing character-mode reports on the UNIX platforms is absolutely
the same as on the Microsoft Windows platforms discussed so far.
The only difference lies in the module names and location of files.

Module Names:
r25desm    -   Oracle Reports Designer (bitmapped only)
r25runm    -   Oracle Reports Runtime  (bitmapped)
r25run     -   Oracle Reports Character-Mode Runtime

Location of .prt files:
$ORACLE_HOME/reports25/admin/printer

When you run character-mode reports, Oracle advises you to use the
character-mode runtime (r25run) to produce ASCII Text output.  You can
edit .prt files the same way as discussed in the sections above.