You can write Oracle Reports reports, integrate them with Oracle Application Object Library, and run them as concurrent programs from your forms or though Standard Request Submission.
In this chapter, the Oracle Reports executable file is referred to as appsrwrun.sh. The name of your Oracle Reports executable file may vary depending on which version of Oracle Reports you use.
You have the option of using Oracle Application Object Library user exits such as dynamic currency formatting with your Oracle Reports programs.
The concurrent manager can run Oracle Reports either in character mode or in bitmap mode according to your specifications. You control the orientation and page size of your report output.
A troubleshooting guide for your Oracle Reports programs appears at the end of this chapter.
Most Oracle Applications reports are launched from the concurrent manager as concurrent processes. In most UNIX systems, the concurrent manager inherits its environment variables from the shell from which it was started; the reports are then run from this environment.
For Oracle Reports programs, the concurrent manager runs the executable appsrwrun.sh on the report description file. This executable includes Oracle Applications user exits. If your Oracle Reports program produces report output, the concurrent manager can automatically print the report output file after your program completes, provided that your site has the appropriate print drivers defined.
Immediately before running a report, the concurrent manager dynamically prepends several values onto the environment variable $REPORTS_PATH, as shown below:
REPORTS_PATH = $[PROD]_TOP/$APPLPLS:$[PROD]_TOP/$APPLREP
:$[PROD]_TOP/$APPLREP/LANGDIR
:$AU_TOP/$APPLPLS:$REPORTS_PATH
This puts the PL/SQL libraries in the $[PROD]_TOP/$APPLPLS, any other report objects such as external queries, boiler plate text etc. in $[PROD]_TOP/$APPLREP, and sharable libraries in $AU_TOP/$APPLPLS in REPORTS_PATH before the concurrent manager runs a report. $[PROD]_TOP is the application basepath of the application owning the report, and LANGDIR is the directory for a particular language, such as US or FR.
The APPLSYS.env, set at installation, sets REPORTS_PATH to $AU_TOP/$APPLPLS. This may be modified to include customized libraries.
See: Oracle Applications Concepts
If you define a concurrent program with the bitmapped version of Oracle Reports, select PostScript, HTML, or PDF as appropriate from the Output Type poplist in the Define Concurrent Program form.
You can control the orientation of the bitmapped report by passing the ORIENTATION parameter or token. For example, to generate a report with landscape orientation, specify the following option in the Execution Option field:
ORIENTATION=LANDSCAPE
Do not put spaces before or after the execution options values. The parameters should be separated by only a single space. You can also specify an orientation of PORTRAIT.
You can control the dimensions of the generated output with the PAGESIZE parameter. A specified <width>x<height> in the Execution Options field overrides the values specified in the report definition. For example:
ORIENTATION=LANDSCAPE PAGESIZE=8x11.5
The units for your width and height are determined by your Oracle Reports definition. You set the units in your Oracle Reports menu under Report => Global Properties => Unit of Measurement.
If the page size you specify with the PAGESIZE parameter is smaller than what the report was designed for, your report fails with a "REP-1212" error.
Though the concurrent manager passes program arguments to your Oracle Reports program using tokens (so that their order does not matter), you should write your program to receive arguments in the same order that you specify when you call your program and pass arguments for easier maintenance.
Your Oracle Reports program parameters should not expect NULL values. The concurrent manager cannot pass a NULL value to your program.
For Oracle Reports programs you have a choice of two implementation methods.
If you choose to make your Oracle Reports program available through Standard Request Submission, you check the Use in SRS check box of the Concurrent Programs form and define your arguments in the Concurrent Program Parameters block. Your program is available for the Submit Request form once you use Oracle System Administration to add your program to the appropriate report security groups.
If you also call your program using FND_REQUEST.SUBMIT_ REQUEST from a form other than the Submit Request form, you supply values for your arguments in the order in which you registered them. The concurrent manager automatically adds the tokens you defined when you registered your arguments to the values you supply when you submit the program from the Submit Request form or from FND_REQUEST. The concurrent manager passes tokenized arguments (token1=parameter1, token2=parameter2, etc.) to your Oracle Reports program. In this case, each parameter value can be up to 240 characters in length, excluding the length of the associated token.
If you do not wish to make your Oracle Reports program available through Standard Request Submission, you pass tokens to your Oracle Reports program in your FND_REQUEST call from a form. In this case you do not check the Use in SRS check box of the Concurrent Programs form. Note that each argument of the form TOKEN=parameter must be a maximum of 240 characters in length, including the token name.
Oracle Application Object Library lets you access user profile information and run user exits from your Oracle Reports program by including the appropriate calls in your program. These Oracle Application Object Library calls also allow your report to access the correct organization (for multiple organizations or "multi-org" installations) automatically.
To access profile values, multiple organizations, or Oracle Applications user exits, and for your program to be used with concurrent processing at all, you must have the first and last user exits called by your Oracle Reports program be FND SRWINIT and FND SRWEXIT.
FND SRWINIT sets your profile option values and allows Oracle Application Object Library user exits to detect that they have been called by a Oracle Reports program. FND SRWEXIT ensures that all the memory allocated for Oracle Application Object Library user exits has been freed up properly. The steps below ensure that your program correctly calls FND SRWINIT and FND SRWEXIT.
Warning: With future releases of Oracle Application Object Library and Oracle Reports, we may provide a simpler set of steps to access FND SRWINIT and FND SRWEXIT. We reserve the right to discontinue support for these steps. If you use the steps below to integrate your Oracle Reports programs with Oracle Application Object Library, you should plan to convert to a different set of integration steps in the future.
Create a lexical parameter P_CONC_REQUEST_ID with the datatype Number. The concurrent manager passes the concurrent request ID to your report using this parameter.
Call FND SRWINIT in the "Before Report Trigger."
Call FND SRWEXIT in the "After Report Trigger."
These integration steps let you call certain Oracle Application Object Library user exits, in addition to FND SRWINIT and FND SRWEXIT, to access user profile values and perform calculations in your Oracle Reports program:
FND FLEXSQL
FND FLEXIDVAL
See: Oracle Applications Flexfields Guide
Note that you can call many Oracle Applications PL/SQL routines, such as user profiles routines, from your Oracle Reports programs as well as these user exits. In general, you should use PL/SQL routines instead of user exits where possible.
You can test your Oracle Reports program that calls Oracle Applications user exits by running appsrwrun.sh from the operating system.