The objective of this session is to add a "Print" feature to the simple browsing application.
Users may want to print the content of a presentation. You can add this functionality to the simple application easily by using predefined, custom BI Beans JSP tags.
BI Beans includes JSP tags that let you create a presentation page that is printer-friendly (that is, the presentation is formatted to print entirely on a page). Next, you will create this "Printer Friendly" page.
printerFriendlyJSP.jsp
as the filename.app
and
the same connection configuration file /Project1BIConfig1.xml
.<%--
Insert your Business Intelligence tags here --%>
comment.In the PrinterFriendlyView wizard, you can define the attribute values for the PrinterFriendlyView tag.
printerFriendly.
In the Code Editor, you can see the code that was generated for the PrinterFriendly tag. The following code creates the PrinterFriendly tag:
<orabi:PrinterFriendlyView id="printerFriendly" />
The following code displays the presentation in printer-friendly format:
<orabi:Render targetId="printerFriendly" parentForm="BIForm" />
From the File menu, choose Save All to save the JSP application.
You want to provide users with the ability to specify printing options before generating the printer-friendly page. Now, you will create a page that contains these printing options.
printJSP.jsp
as the filename.app
and the same connection configuration file /Project1BIConfig1.xml
.<%--
Insert your Business Intelligence tags here --%>
comment.In the PrintOptions wizard, you can define the attribute values for the PrintOptions tag.
print
.In the Code Editor, you can see the code that was generated for the PrintOptions tag. The following code creates the PrintOptions tag:
<orabi:PrintOptions id="print" applyPage="printerFriendlyJSP.jsp"
printerFriendlyViewId="printerFriendly" />
The following code displays the "Print" dialog:
<orabi:Render targetId="print" parentForm="BIForm" />
<%-- The InsertHiddenFields tag adds state fields to the parent
form tag --%>
comment.In the Code Editor, you can see the code that was generated for the ApplyButton tag. The following code creates an apply button for printing:
<orabi:ApplyButton id="printJSP_ApplyButton1" dialogId="print"
/>
The following code displays the apply button:
<orabi:Render targetId="printJSP_ApplyButton1" parentForm="BIForm"
/>
<%-- The
InsertHiddenFields tag adds state fields to the parent form tag --%>
comment. Press Enter to move the comment to the next line.In the Code Editor, you can see the code that was generated for the CancelButton. The following code creates an apply button for canceling:
<orabi:CancelButton id="printJSP_CancelButton1" dialogId="print" />
The following code displays the cancel button:
<orabi:Render targetId="printJSP_CancelButton1" parentForm="BIForm"
/>
From the File menu, choose Save All to save the JSP application.
Finally, we need to add a "Print" button to the viewer page so that users can access the "Print Options" page to print the presentation.
<%-- The InsertHiddenFields tag adds state fields to the parent
form tag --%>
comment.In the DialogLink wizard, you can define the attribute values for the DialogLink tag.
printDialogLink
.Print
.In the Code Editor, you can see the code that was generated for the DialogLink tag. The following code creates a button for linking to the "Print" page:
<orabi:DialogLink id="printDialogLink" presentationId="viewer" targetPage="printJSP.jsp"
targetToolId="print" text="Print" />
The following code displays the linking button:
<orabi:Render targetId="printDialogLink" parentForm="BIForm" />
From the File menu, choose Save All to save the JSP application.
You have created a simple application that allows users to print a presentation.
You added the "Print" feature to a simple application easily without writing a single line of code.
7. Adding "Export" Functionality | Overview | 9. Deploying a JSP Application