Using the Page Setup Dialog

You can use the Page Setup dialog that is provided with the BI Beans user interface for Java-client applications, to allow users to specify settings for the printed page. The PageSetupDialog class is defined in the oracle.dss.dataView.gui package.

The PageSetupDialog requires an implementation of the PrintDialogsProvider interface. The default implementation of this interface is the PrintDialogsAdapter. It displays the system print dialog or initiates printing. You might want to display the BI Beans print dialog instead.

If you do not want the default behavior, you can extend the PrintDialogsAdapter, overriding the showPrintDialog method. The Java-client sample "Printing Crosstabs" includes an extension of the PrintDialogsAdapter. In the BIPrint class, look for the private inner class BIPrintDialogsAdapter.

Example: Calling the PageSetupDialog from a File menu

The following example shows how to call the PageSetupDialog from a File menu. This example references the BIPrintDialogsAdapter class, which extends the PrintDialogsAdapter. This example also assumes that you have created an instance of a PrinterJob called m_printerJob.


PageSetupDialog dialog = new PageSetupDialog(this, "Page Setup", false, m_crosstabPrinter, new BIPrintDialogsAdapter(m_crosstabPrinter, m_printerJob)); dialog.setVisible(true); dialog.dispose(); dialog = null;

The following example shows how the BIPrintDialogsAdapter overrides the showPrintDialog method:


public void showPrintDialog(Frame f){ PrintDialog dialog = new PrintDialog(f, m_crosstabPrinter, m_printerJob); dialog.show(); dialog.dispose(); dialog = null; }