In this chapter, you will learn about reports that include a barcode. By following the steps in this chapter, you can generate the report output shown in Figure 43-1.
Figure 43-1 Barcode JavaBean Web report output
By using a barcode JavaBean, you can build reports that display a barcode to make tasks like tracking shipping orders and employee identification numbers easier.
You can create a paper or Web report that uses JavaBeans. For a paper report, you must use the Java Importer to create a PL/SQL wrapper so that you can call the JavaBean from your PL/SQL business logic. For a JSP-based Web report, you must call the JavaBean from your report. In Reports Builder, the JavaBean automatically generates the barcode for you.
Note:
For information about the Java Importer, and the ORA_JAVA
built-in package, see Oracle Reports online Help topics under Reference > Java Importer.
You can learn more about the barcode JavaBean on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html
), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Any Format. In the expanded list of sub-topics, click PL/SQL-Java Bridge.
In this example, you will build two reports, one for paper and one for the Web. The paper report shows an invoice for a single customer who has ordered multiple items from a company. The barcode indicates the tracking information for the order.
As you build these example reports, you will:
Create a Barcode Report for Paper:
Import the Java classes into Reports Builder using the Java Importer to add the barcode JavaBean.
Create a package to store your information using the Program Unit editor.
Create a Before Report trigger to set up your barcode JavaBean for the report.
Create a query in the Data Model view to retrieve the data from the schema..
Create a Barcode Report for the Web:
Create three formula columns in your data model to call the barcode data for the report.
Initialize the barcode JavaBean and set its properties by editing the JSP code in the Web Source view.
Run your report to the Web to view the output in a browser.
To see a sample paper report with a barcode, open the examples folder named barcodebeanpaper
, then open result\shipping_manifest.pdf
. To see a sample Web-based JSP report with a barcode, open the examples folder named barcodebeanweb
, then open result\shipping_manifest_web.jsp
. For details on how to open these reports, see "Accessing the Example Reports" in the Preface. The example files used in this chapter are listed and described in Table 43-1
.
Table 43-1 Example report files
File | Description |
---|---|
|
The final PDF version of the paper report, containing the barcode. |
|
The final RDF version of the paper report, containing the barcode. |
|
The barcode JavaBean. |
|
All the code used in this chapter, so you can copy and paste the code from this file instead of typing it manually. |
|
The source file for the sample paper report. Running this RDF in Reports Builder will display the final result of your paper report in the Paper Design view. |
|
The final JSP version of the Web report, containing the barcode. |
|
The final RDF version of the Web report, containing the barcode. |
|
The images that Oracle Reports generated when the JSP was run. |
|
The SQL for the query you need to enter. |
|
All the code used in this chapter, so you can copy and paste the code from this file instsead of typing it manually. |
|
The HTML page that you will use as a basis for the Web report. |
|
The source file for the sample Web report. Running this RDF in Reports Builder to the Web will display the final result of your Web report in your browser. |
|
The images and other files that your JSP-based Web report will require to display properly on the Web. |
|
The image you will use in your JSP-based Web report. |