9.9 Frequently Asked Questions

This section addresses some commonly encountered problems with UNIX printing.

Note:

Reports Server uses rwlpr for submitting a print job. For rwlpr logging for Windows, when you enable tracing for Reports Server using either traceModule=all or traceModule=server, a printing diagnostic log (server_name-rwlpr-jobid.log) is created in the log directory ($ORACLE_INSTANCE/diagnostics/logs/ReportsServerComponent/<reports server name>) for destype=printer. This log file will contain information regarding the messages that can be used to diagnose any printing issues, such as spooler problem.

9.9.1 Common Printing Error Messages

REP-00177 - Error while running in remote server

REP-1800 - Formatter error

REP-3300 - Fatal error in component name

UI-9 - This function call is out of context.

REP-3002: Internal error initializing printer information

Cause:

These errors generally indicate a printer configuration issue.

Action:

Check the printer queues that have been defined at the operating system level in your setup. You can use:

  • lpc status

  • lpstat -a

If a valid printer queue is installed, check for the following:

  • uiprint.txt must have a valid entry for the printer.

  • Oracle Reports must be able to open and read the uiprint.txt file:

    The person running the report must have operating system level read permissions on uiprint.txt. Oracle Reports must be able to open the uiprint.txt. UNIX operating systems do have an open file limit. If you are over that limit, Oracle Reports might not be able to open uiprint.txt.

  • The printer description files specified in uiprint.txt must exist in your installation in:

    ORACLE_INSTANCE/config/FRComponent/frcommon/guicommon/tk/admin
    
  • The printer specified in uiprint.txt must be enabled at the operating system level. A quick test is to try printing any file from the command line using lp or lpr. If you can print using one of these commands and get the output on the printer, then the printer is enabled.

  • The printer queue and uiprint.txt entry syntax must be valid.

    If the printer validation fails, refer to the environment variables TK_PRINT_STATUS and REPORTS_NO_DUMMY_PRINTER in Appendix B, "Environment Variables".

REP-00826 - Invalid printer driver xxx specified by parameter desformat.

REP-00177 - Error while running in remote server (When run through CGI)

Cause:

An invalid value was specified for DESFORMAT for the specified report execution mode.

Action:

The DESFORMAT parameter specifies which output format is needed. Valid formats are:

  • For bitmapped reports, any of the output formats supported by Oracle Reports (PostScript, PCL, PDF, HTML, XML, HTMLCSS, ENHANCEDSPREADSHEET, SPREADSHEET) is valid for DESFORMAT. You should not give the PRT file names here. While running to a file, the DESFORMAT parameter needs to be set to a valid printer queue. Oracle Reports uses the printer definition file associated with the printer to format the output.

  • For character mode reports, DESFORMAT sets up the output for ASCII printers and passes escape characters. For running character mode reports, ensure that you change the MODE parameter to Character and use any valid .PRT file.

Table 9-7 maps the command line options (DESTYPE, DESNAME, and DESFORMAT) to the printer by what you are trying to achieve.

Table 9-7 DESTYPE, DESNAME, and DESFORMAT Settings By Case

Case DESTYPE DESNAME DESFORMAT

Generating to a file

FILE

file_name.ps

printer_name

Printing

PRINTER

printer_name

 

DISTRIBUTE=YES

   

printer_name

MODE=CHARACTER

   

file_name.prt


REP-01800 - Formatter error.

REP-00177 - Error while running in remote server

(When run through CGI)

Cause:

The error indicates that a printer configuration issue has occurred on a UNIX server. Even if there is not a physical printer available on the system, you have to set it up as if there was one.

Action:

  1. Verify that there is a valid entry in uiprint.txt.

  2. If you have multiple printer queue entries in uiprint.txt and you want to set the default printer, verify that the environment variable is set to a printer that is listed in uiprint.txt. If the related environment variable is not set, then the first entry in uiprint.txt is used. For more information on printer-related environment variables, refer to Appendix B, "Environment Variables".

If there is no printer available for your system, refer to Section 9.3, "Configuring the Printing Environment" for alternatives.

Error while printing to a printer with spaces in its name

Cause:

If you are on Solaris 2.8 and have printers that have spaces in the names, you may encounter a bug that causes an error resulting from the lpr/lp command including quotes around the printer name.

Action:

To resolve this issue, you must do either one of the following:

  • Remove the spaces in the printer's name.

  • Install the Solaris 2.8 patch from Sun Microsystems that fixes the lpr/lp command so that quotes can be used in printers names.

    and

  • Modify the section of rwlpr.sh that provides the workaround for including quotes, in order to make accessible any printer that has a space in the name. The rwlpr.sh file is located in the $ORACLE_INSTANCE/config/reports/bin directory.

    Specifically, make the following changes:

    #either LPR or LP Command was found 
    if [ -x $PRNCMDPATH ]
     then
       if [ `basename $PRNCMDPATH` = "lpr" ]
       then
        #if [ `/usr/bin/uname -r` = "5.8" ]
        #then
          #$PRNCMDPATH `echo $@ | tr -d "\""`
        #else
          $PRNCMDPATH "$@"
        #fi
      else
       # parse and Fix the command Line as Required by lp
       #if [ `/usr/bin/uname -r` = "5.8" ]
       #then 
         #getLpCommandLine `echo $@ | tr -d "\""`
       #else
         getLpCommandLine "$@"
       #fi
       $PRNCMDPATH
      fi  
      # exit with the command's exit code , This will tell the 
      # server Print module if the command completed successfully 
      # or not.
      exit $?
    fi
    done
    

Printing on Solaris 2.9

If you print a report using the DESTYPE=PRINTER and the DESNAME=printer_name command line options on Solaris 2.9, you will encounter the following errors:

REP-0069: Internal error
REP-57054: Inprocess job terminated with error
REP-50157: Error while sending file to printer 2op837a.Exit with error code 1

To resolve this issue, you must do the following:

Note:

Create a backup of the rwlpr.sh file before proceeding. On Solaris, rwlpr.sh is the printing script file located in the $ORACLE_INSTANCE/config/reports/bin directory. This script file supports lp and lpr commands by default.

  1. Navigate to the following line at the end of the file:

    #either LPR or LP Command was found
    
  2. Add an OR operator to the existing if...else condition.

    if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ] # If Solaris Release 5.8 / 5.9
       ...
       else
       # parse and Fix the command Line as Required by lp
                                            ...
         if [ `uname -r` = "5.8" ] || [ `uname -r` = "5.9" ]# If Solaris Release   
         5.8/ 5.9 
    
  3. The if...else if condition checks for the Solaris Release version. Based on the version number, it strips the quotes from the printer name and passes it to the print command.

9.9.2 PCL Printing Issues

Why do fields that appear as gray on my PC print as white on a UNIX PCL printer?

PCL color printing is not supported. When the pattern is set to transparent, PCL printing uses the white pen (in PCL language) to draw. When the pattern is set to a solid pattern, it uses the black pen. This behavior occurs irrespective of what color is set for the foreground or background. PostScript printing logic is different. It uses the foreground color set when the pattern is solid and the background color set when the pattern is transparent.

What PCL level is supported in Oracle Reports?

The Oracle Reports PCL driver currently supports the features of PCL Level 3. It does support HPD files for later PCL versions, but it will not honor the additional features introduced since PCL Level 3.

9.9.3 PostScript Printing Issues

What is the work around for duplex printing on PostScript printers?

You should have a printer with a duplex option and an appropriate PPD file. The example that follows was tested with a PPD file for the Kyocera FS-9000 printer. You also need the UNIX sed tool named to filter the output file.

The problem with duplexing is that it is enabled at the job level, but it gets reset in the page setup because the paper size and printer tray information are generated for every page. To work around this problem, you need a script that removes the page level setup information to avoid resetting the duplex setting. A side effect of this work around is that you cannot switch the printer tray between pages.

  1. Write a sed script with the following three lines:

    /î%%BeginPageSetup/,$ {
       /î%%BeginFeature/,/î%%EndFeature/d
    }
    
  2. Save the script to a file named duplexsed.

  3. Copy duplexsed to an appropriate directory, such as ORACLE_HOME/bin.

  4. Set the environment variable TK_PRINT as follows:

    TK_PRINT="sed -f $ORACLE_HOME/bin/duplexsed | lpr -l -s -P'%n' -#'%c'"
    export TK_PRINT
    

    Note:

    Print commands differ for various kinds of UNIX. Check your installation guide and man pages for your platform. Refer to Appendix B, "Environment Variables" for a description of TK_PRINT.

    The command stored in TK_PRINT is only executed if DESTYPE=PRINTER. If DESTYPE=FILE, you still get a PostScript file with page level setup information. You can run the duplexsed script against the PostScript file to correct it.

What PostScript level is supported in Oracle Reports?

Oracle Reports supports PostScript Level 1 and 2.

How do you dynamically change the printer tray setting in the midst of a print job?

In some cases, you may want to switch printer trays in the middle of a report. For example, you might want the first page of a report printed on letterhead stationary and subsequent pages printed on plain white paper. For character mode reports, you can achieve this result through a combination of editing the .prt file and changing the report's properties. For bit-mapped reports, you use the SRW.SET_PRINTER_TRAY built-in procedure. On UNIX, this functionality is supported for PostScript output but not PCL output. For PCL, Oracle Reports ignores the commands for changing orientation and paper tray. Although dynamically changing the orientation and printer tray for PCL is not supported on UNIX, you can change them at runtime through the print dialog box for PCL.

By using the Before Report, Between Pages, or format triggers you can switch to different printer trays as your report formats. This enables you to easily print pages of the same report on different sheets of paper.

Note:

For a description of the SRW built-in package, including the SRW.SET_PRINTER_TRAY built-in procedure, see the Oracle Reports online Help.

Example

From the BEFORE REPORT trigger, you can set the printer tray for the very first page:

function BeforeReport return boolean is
begin
    srw.set_printer_tray('UPPER PAPER TRAY');
    return (TRUE);
end;

To set the printer tray dynamically for subsequent pages, add a format Trigger to an item that prints on each page of the report. The following code checks for even pages and sets the page number accordingly:

function B_tbpFormatTrigger return boolean is
page_num number;
begin
   srw.get_page_num(page_num);
  begin
 if mod(page_num, 2) = 0 then  
   srw.set_printer_tray('UPPER PAPER TRAY'); 
  else 
   srw.set_printer_tray('LOWER PAPER TRAY');
 end if;         
  return (true);
end;
end; 

Why does the external print command ignore the tray select option while trying to print the PostScript output generated by Oracle Reports?

Suppose that you enter the following print command:

lp -dprinter -oupper $report_print_file1

In this case, the -oupper option in the lp command is ignored. The reason for this behavior is that Oracle Reports generates tray information in its PostScript output. The tray selection in the PostScript overrides the specification on the command line. If you want the tray information on the command line to be respected, you must remove the tray information from the PostScript file. You can do this by searching for and removing the following from your PostScript file:

%%BeginFeature: *InputSlot name of printer tray   
....
%%EndFeature

For more information on switching printer trays, refer to How do you dynamically change the printer tray setting in the midst of a print job?

9.9.4 Font-Related Printing Issues

See Also:

How do you check whether a font is used in Oracle Reports printing?

PostScript files have a list of fonts, which is created after reading the PPD file. If you examine the PostScript file, you can check the fonts by looking for the following tags:

  • DocumentNeededResource has the list of fonts referenced in the PPD file.

  • DocumentSuppliedResource has the list of fonts for which the PostScript driver was able to find corresponding AFM files.

  • %%Page before the field's %IncludeResource:font has the font name that will be used for the field.

For PCL output files, you can check whether a particular font was used. Depending on this information, the font settings in Oracle Reports or the printer can be modified.

What is the real difference between running reports to Screen and Preview?

Formatting a report to Screen, for screen fonts, guarantees that the report will look good in the Paper Design view of the Report Editor. If an attempt is made to print a report formatted with screen fonts, though, it is likely to come out with some differences because screen fonts typically map very poorly to printer fonts. If Preview is selected instead of Screen, the report is formatted with printer fonts and the output on the screen is almost certain to match the printed output.

Will there be any font issues if I do not have a valid printer installed?

Prior to Oracle Reports 10g on UNIX, you had to set the DISPLAY environment variable in order for Reports Server to use the windowing system display surface for creating images and getting pixel resolution. This dependency is removed with Oracle Reports 10g.

Additionally, earlier releases required a valid printer on UNIX for fonts. When no valid printer was available, Oracle Reports Services used the screen fonts, which again required setting the DISPLAY environment variable. Now, Oracle Reports Services includes a default screen printer surface, ScreenPrinter, that emulates a screen or printer for fonts in the absence of an available printer. As a result, Oracle Reports Services no longer requires a printer on UNIX.

9.9.5 Printed Output Issues

Why does my report look okay on the screen but have truncated data when printed?

Any one of a number of possible causes may account for the truncation of fields.

  • Check the field and determine if it is allowed to expand.

    1. In Oracle Reports Builder, double-click the field in the Paper Design or Paper Layout view to display the Property Inspector.

    2. Find the Horizontal Elasticity property.

    3. If it is set to Fixed, you should change it to Variable or Expand.

    4. Run the report to the printer.

    5. If it still truncates, it could be that the field requires multiple lines.

    6. Return to the Property Inspector for the field and check its Vertical Elasticity.

    7. If it is set to Fixed, you should change it to Variable or Expand.

    8. Run the report to the printer again.

  • If the right most fields on the page are always the ones truncating, it could be an issue with the printable area of the printer. If you are using a PCL printer, then you will have to estimate the size of the printable area and resize your margins accordingly:

    1. Open the report in Oracle Reports Builder.

    2. Go to the Paper Layout view.

    3. Click the Margin tool on the top tool bar. A thick black line appears indicating where the body of your report ends and the margin begins.

    4. Click and drag the black line to the left approximately 0.5 inches.

    5. Save and run the report to the printer again.

    6. If necessary, repeat steps 4 and 5 to determine approximately where the printable area boundary is located and then ensure that your report body fits within that area.

  • If you are using a PostScript printer, you can get the printable area boundary to appear in the Paper Layout view as follows:

    1. Open the report in Oracle Reports Builder.

    2. Choose File > Page Setup.

    3. Verify that the margins are small and that the orientation is correct.

    4. Click OK. The Paper Layout view should now be able to read the boundary.

    5. Go to the Paper Layout view.

    6. Click the Margin tool on the top tool bar. A thick black line appears indicating where the body of your report ends and the margin begins. A black hashed line also appears indicating the boundary of the printable area.

    7. Ensure that the thick black line is inside of the black hashed line. If it is not, click and drag the black line inside the printable area.

    8. Click the Margin tool to leave margin mode.

    9. If necessary, reposition your fields to fit within the new body boundaries.

    10. Save and run the report to the printer.

  • For PCL, if it is still truncating, try using a fixed space font instead of a proportional font. Sometimes PCL printers have problems interpreting proportional space fonts and it leads to truncation. You should try using a fixed space font, such as Courier, and possibly font aliasing.

    See Also:

    Chapter 8, "Managing Fonts in Oracle Reports" for more font-related information.

    Note:

    Default layouts are built against a generic printer. Each printer has its own printable area. As a result, you may have to reset the report to fit the printer. Ideally, if you know the various printers you will be using, you can design the report from the start to fit the printer with the smallest printable area.