|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.dss.dataView.ViewPrinter
Base class for printing or previewing data-aware controls. If you use the PrinterDialog
class in oracle.dss.dataView.gui
, then you do not need to call any of the methods in this class. Instead, you need only to create an instance of the appropriate subclass of this class and pass it in the PrinterDialog
constructor. The ViewPrinter
takes responsibility for the print job. It takes ownership of the entire page that is printed, and it manages pagination and other printing tasks.
If you create your own UI, then you call methods of a ViewPrinter
subclass.
There are three different methods for printing:
print
-- use when you are printing to a full page and you are printing a single logical page or all logical pages of a view. The view printer gets the page size from the print job. You set properties to specify margins. The view printer respects margin settings. You call setRangeType
to specify how much of the view to print.renderPage
-- use when you want to print a view and any other object on the same printed page, or when you want more control over the logical pages that are printed. For example, use renderPage
if you have a crosstab and a graph that display the same data, and you want to print the first logical page of the crosstab, then the first logical page of the graph, then the next logical page of the crosstab, and so on.renderPage
if you provide your own UI for print preview.setRangeType
to specify how much of the view to print. You call setViewDimension
to specify the area into which the view should be printed. The view printer respects margin settings.printPage
-- use when you want to print part of a table or crosstab, but you do not want to start printing at the first row and column of the view. You can also use printPage
to print a graph.setLogicalPage
to specify the page to print. You call setViewDimension
to specify the area into which the view should be printed. The view printer does not respect margin settings.print(boolean)
, renderPage(java.awt.Graphics)
, GraphPrinter.printPage(Graphics)
, CrosstabPrinter.printPage(java.awt.Graphics)
, CrosstabPrinter.printPage(Graphics, DataSubsetRecord)
, TablePrinter.printPage(Graphics)
, TablePrinter.printPage(Graphics, DataSubsetRecord)
, PrintDialog
Field Summary | |
static int |
ADJUST_FOR_HEADERS_AND_FOOTERS Margin adjustment: When headers or footers do not fit in the specified margin, the margins are enlarged so that the headers or footers fit. |
static int |
ALL_LOGICAL_PAGES Range type: Print all the logical pages in the view. |
static int |
CURRENT_LOGICAL_PAGE Range type: Print only the current logical page of the view. |
static int |
FOOTER_CENTER The center footer. |
static int |
FOOTER_LEFT The left footer. |
static int |
FOOTER_RIGHT The right footer. |
static int |
HEADER_CENTER The center header. |
static int |
HEADER_LEFT The left header. |
static int |
HEADER_RIGHT The right header. |
static int |
HEADERS_AND_FOOTERS_ALL All headers and footers. |
static int |
HEADERS_AND_FOOTERS_NONE No headers or footers. |
static int |
IGNORE_HEADERS_AND_FOOTERS Margin adjustment: When headers or footers do not fit in the specified margin, they are printed over the view in the printable area. |
static int |
OCCLUDE_HEADERS_AND_FOOTERS Margin adjustment: When headers or footers do not fit in the specified margin, the margins are unchanged. |
static int |
ORIGINAL_SIZE Print scale type: Print the view at its current size. |
static int |
SCALE_TO_FIT_FULL_PAGE Print scale type: Print the graph so that it fills the entire physical page. |
static int |
SCALE_TO_FIT_PAGE Print scale type: Print the graph so that it fills the physical page, keeping its on-screen proportions. |
static int |
SCALE_TO_FIT_PAGES Print scale type: Scale the view to fit on the specified numbers of pages. |
static int |
SCALE_TO_ZOOM_FACTOR Print scale type: Scale the view according to the PrintZoomFactor property of this ViewPrinter . |
static int |
SELECTED_LOGICAL_PAGES Range type: Print selected logical pages in the view. |
Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
ViewPrinter(Dataview dv) Constructor. |
Method Summary | |
abstract void |
endPrint() Sets the view back to its original state. |
int |
getBottomMargin() Retrieves the height of the bottom margin of printed physical pages. |
CustomHeaderAndFooterCallback |
getCustomHeaderAndFooterCallback() Retrieves the callback that this ViewPrinter uses for displaying custom headers and footers. |
Dataview |
getDataview() Retrieves the Dataview that this ViewPrinter prints. |
int |
getFitToNumPagesTall() Retrieves the number of physical pages on which a printed view is required to fit vertically. |
int |
getFitToNumPagesWide() Retrieves the number of physical pages on which a printed view is required to fit horizontally. |
int |
getFooterMargin() Retrieves the height of the footer margin. |
HeaderAndFooterPainter |
getFooterPainter() Deprecated. As of 1.6.0.9, replaced by getHeaderAndFooterPainter(int) |
HeaderAndFooterPainter |
getHeaderAndFooterPainter(int headerOrFooterID) Retrieves a header or footer painter. |
int |
getHeaderMargin() Retrieves the height of the header margin. |
HeaderAndFooterPainter |
getHeaderPainter() Deprecated. As of 1.6.0.9, replaced by getHeaderAndFooterPainter(int) |
int |
getHeadersAndFootersUsingCallback() Retrieves the headers and footers that use a custom callback. |
int |
getLeftMargin() Retrieves the left margin of printed physical pages. |
int[] |
getLogicalPage() Retrieves the logical page to be printed, when you use the printPage method to print. |
int |
getMarginAdjustment() Retrieves the setting for how the margin responds when a header or footer does not fit. |
java.awt.print.PageFormat |
getPageFormat() Retrieves the PageFormat object that specifies the paper size for this ViewPrinter . |
java.awt.PrintJob |
getPrintJob() Retrieves the PrintJob object for this ViewPrinter . |
int |
getPrintScaleType() Retrieves information about how the DataView is scaled for printing. |
int |
getPrintZoomFactor() Retrieves the zoom factor for printing. |
int |
getRangeType() Retrieves information about how much of the view will be printed. |
int |
getRightMargin() Retrieves the width of the right margin of printed physical pages. |
abstract int |
getScaleFontSize() Retrieves the text components to resize when a graph is scaled to a different size for printing. |
java.util.Vector |
getSelectedHPos() Retrieves the hierarchical addresses of the logical pages to print, when RangeType is set to SELECTED_LOGICAL_PAGES . |
int |
getSequentialPageNumber() Retrieves the current physical page number that this ViewPrinter has printed. |
TokenSubstitution |
getTokenSubstitution() Retrieves the handler for token substitution in this ViewPrinter . |
int |
getTopMargin() Retrieves the height of the top margin of printed physical pages. |
java.awt.Dimension |
getViewDimension() Retrieves the space allowed for printing a view, when you assume responsibility for a print job. |
abstract boolean |
goToFirstPage() Deprecated. As of 1.6.0.9, replaced by prepareFirstPage(Graphics) |
abstract boolean |
goToNextPage() Deprecated. As of 1.6.0.9, replaced by prepareNextPage(Graphics) |
abstract boolean |
goToPrevPage() Deprecated. As of 1.6.0.9, replaced by preparePrevPage(Graphics) |
abstract boolean |
hasNextPage() Indicates whether the view has a physical page after the current physical page. |
abstract boolean |
hasPrevPage() Indicates whether the view has a physical page before the current physical page. |
abstract boolean |
isFirstPhysicalPage() Indicates whether the current physical page is the first physical page in the current logical page. |
boolean |
isGridlinesVisible() Indicates whether gridlines appear in a printed GridView . |
abstract boolean |
isLastPhysicalPage() Indicates whether the current physical page is the last physical page in the current logical page. |
boolean |
isPrintByColumns() Indicates whether physical pages are printed by rows (left-to-right then top-to-bottom) or by columns(top-to-bottom then left-to-right). |
abstract boolean |
isRepeatHeaders() Indicates whether column and row headers are displayed on every physical page, when a table or crosstab is printed on multiple physical pages. |
abstract boolean |
prepareFirstPage(java.awt.Graphics g) Prepares the first physical page in the view for printing and makes it the current page to print. |
abstract boolean |
prepareNextPage(java.awt.Graphics g) Prepares the next physical page for printing and makes it the current page to print. |
abstract boolean |
preparePrevPage(java.awt.Graphics g) Prepares the previous physical page for printing and makes it the current page to print. |
boolean |
print(boolean endPrintJob) Prints a Dataview , onto multiple physical pages if necessary. |
int |
print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex) Prints a physical page of this Dataview to a Graphics . |
boolean |
renderPage(java.awt.Graphics g) Renders a physical page of a view to a Graphics object. |
void |
setBottomMargin(int mrgn) Specifies the height of the bottom margin of printed physical pages. |
void |
setCustomHeaderAndFooterCallback(CustomHeaderAndFooterCallback callback) Registers a custom callback with this ViewPrinter . |
void |
setFitToNumPagesTall(int num) Specifies the number of physical pages on which to fit a printed view vertically. |
void |
setFitToNumPagesWide(int num) Specifies the number of physical pages on which to fit a printed view horizontally. |
void |
setFooterMargin(int mrgn) Specifies the height of the footer margin. |
void |
setGridlinesVisible(boolean visible) Specifies whether gridlines appear in a printed GridView . |
void |
setHeaderMargin(int mrgn) Specifies the height of the header margin. |
void |
setHeadersAndFootersUsingCallback(int mask) Specifies the headers and footers to which a custom callback applies. |
void |
setLeftMargin(int mrgn) Specifies the width of left margin of printed physical pages. |
boolean |
setLogicalPage(int[] hPos) Specifies the logical page to print, when you use the printPage method to print. |
void |
setMarginAdjustment(int adjustment) Specifies how the margin behaves when a header or footer does not fit in the margin. |
void |
setPageFormat(java.awt.print.PageFormat pf) Specifies the PageFormat object that specifies paper size for this ViewPrinter . |
void |
setPrintByColumns(boolean byColumns) Specifies whether physical pages are printed by columns (left-to-right then top-to-bottom) or by rows(top-to-bottom then left-to-right). |
void |
setPrintJob(java.awt.PrintJob job) Specifies the PrintJob to use for printing. |
void |
setPrintScaleType(int type) Specifies how to scale the DataView for printing. |
void |
setPrintZoomFactor(int zoom) Specifies the zoom factor for printing. |
void |
setRangeType(int type) Specifies whether to print the current logical page or all logical pages. |
abstract void |
setRepeatHeaders(boolean repeat) Specifies whether to display the column and row headers on every physical page, when a table or crosstab is printed on multiple physical pages. |
void |
setRightMargin(int mrgn) Specifies the width of the right margin of printed physical pages. |
abstract void |
setScaleFontSize(int mask) Specifies text components to resize when a graph is scaled to a different size for printing. |
void |
setSelectedHPos(java.util.Vector printHPos) Specifies logical pages to print, when the RangeType is SELECTED_LOGICAL_PAGES . |
void |
setSequentialPageNumber(int pageNum) Specifies the starting page number for this ViewPrinter . |
void |
setTokenSubstitution(TokenSubstitution token) Specifies a handler for token substitution in this ViewPrinter . |
void |
setTopMargin(int mrgn) Specifies the height of the top margin of printed physical pages. |
void |
setViewDimension(java.awt.Dimension dim) Specifies the space allowed for printing a view. |
boolean |
showPrintJob() Displays the standard Print dialog box. |
abstract boolean |
startPrint() Puts the view in a state for printing. |
abstract boolean |
startPrint(boolean bPreviewMode) Puts the view in a state for printing. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CURRENT_LOGICAL_PAGE
public static final int ALL_LOGICAL_PAGES
public static final int SELECTED_LOGICAL_PAGES
setSelectedHPos
method.setSelectedHPos(java.util.Vector)
public static final int ORIGINAL_SIZE
PrintScaleType
to this value, the view is printed at its current size, as determined by its ZoomFactor
property.public static final int SCALE_TO_ZOOM_FACTOR
PrintZoomFactor
property of this ViewPrinter
. When you set PrintScaleType
to this value, you must also call setPrintZoomFactor
to specify the scale for printing.setPrintScaleType(int)
, setPrintZoomFactor(int)
public static final int SCALE_TO_FIT_PAGES
PrintScaleType
to this value, you must also call setFitToNumPagesTall
and setFitToNumPagesWide
to specify the number of pages on which you want the view to fit.
This value does not work in a GraphPrinter
. If you use it, the graph will be printed at its original size.
setPrintScaleType(int)
, setFitToNumPagesTall(int)
, setFitToNumPagesWide(int)
public static final int SCALE_TO_FIT_FULL_PAGE
public static final int SCALE_TO_FIT_PAGE
public static final int HEADER_LEFT
public static final int HEADER_CENTER
public static final int HEADER_RIGHT
public static final int FOOTER_LEFT
public static final int FOOTER_CENTER
public static final int FOOTER_RIGHT
public static final int HEADERS_AND_FOOTERS_ALL
setHeadersAndFootersUsingCallback(int)
public static final int HEADERS_AND_FOOTERS_NONE
setHeadersAndFootersUsingCallback(int)
public static final int IGNORE_HEADERS_AND_FOOTERS
public static final int ADJUST_FOR_HEADERS_AND_FOOTERS
public static final int OCCLUDE_HEADERS_AND_FOOTERS
Constructor Detail |
public ViewPrinter(Dataview dv)
dv
- The Dataview
that this ViewPrinter
prints.Method Detail |
public boolean print(boolean endPrintJob)
Dataview
, onto multiple physical pages if necessary. The call to this method belongs between calls to startPrint
and endPrint
.endPrintJob
- true
to end the print job with this method, false
not to end the print job. Pass false
only when you plan to print another object, after this Dataview
, using the same print job.true
if the view is successfully printed, false
if the data in the view is not available to this ViewPrinter
.startPrint()
, endPrint()
public void setLeftMargin(int mrgn)
This method has no effect when you use the printPage
method to print.
mrgn
- The width of the left margin, pixels.public int getLeftMargin()
public void setRightMargin(int mrgn)
This method has no effect when you use the printPage
method to print.
mrgn
- The width of the right margin, in pixels.public int getRightMargin()
public void setTopMargin(int mrgn)
This method has no effect when you use the printPage
method to print.
mrgn
- The height of the top margin, in pixels.public int getTopMargin()
public void setBottomMargin(int mrgn)
This method has no effect when you use the printPage
method to print.
mrgn
- The height of the bottom margin, in pixels.public int getBottomMargin()
public void setHeaderMargin(int mrgn)
This method has no effect when you use the printPage
method to print.
mrgn
- The height of the header margin, in pixels.public int getHeaderMargin()
public void setFooterMargin(int mrgn)
This method has no effect when you use the printPage
method to print.
mrgn
- The height of the footer margin, in pixels.public int getFooterMargin()
public void setPrintZoomFactor(int zoom)
DataView
is enlarged or reduced for printing. The value of the PrintZoomFactor
property takes effect only when the PrintScaleType
property is set to SCALE_TO_ZOOM_FACTOR
.
By default, the view is printed at full size (100 percent).
zoom
- The percentage at which to print the view. This methods logs an error if the value is less than 10.setPrintScaleType(int)
public int getPrintZoomFactor()
DataView
is enlarged or reduced for printing. The value of the PrintZoomFactor
property takes effect only when the PrintScaleType
property is set to SCALE_TO_ZOOM_FACTOR
.
By default, the view is printed at full size (100 percent).
setPrintScaleType(int)
public void setPrintScaleType(int type)
DataView
for printing. By default, the view is printed at its original size.type
- A constant that indicates how to scale the DataView
for printing. Most constants begin with SCALE_TO_. The constants are defined in this class and in the GraphPrinter
subclass.ORIGINAL_SIZE
, SCALE_TO_FIT_PAGES
, SCALE_TO_ZOOM_FACTOR
, SCALE_TO_FIT_PAGE
, SCALE_TO_FIT_FULL_PAGE
public int getPrintScaleType()
DataView
is scaled for printing.DataView
is scaled for printing. Most constants begin with SCALE_TO_. The constants are defined in this class and in the GraphPrinter
subclass.ORIGINAL_SIZE
, SCALE_TO_FIT_PAGES
, SCALE_TO_ZOOM_FACTOR
, SCALE_TO_FIT_PAGE
, SCALE_TO_FIT_FULL_PAGE
public void setFitToNumPagesTall(int num)
GraphPrinter
.
For example, suppose that you have a crosstab that has four columns and 40 rows. Suppose that this crosstab would normally print on two sheets of paper, the first 30 rows on page 1 and the remainder on page 2. You could set FitToNumPagesTall
to 1 in order to reduce the printed size of the crosstab so that all 40 rows are printed on one sheet of paper.
The view is scaled to fit the number of pages that you specify only when the PrintScaleType
property is set to SCALE_TO_FIT_PAGES
.
num
- The number of pages on which the view should fit vertically.setPrintScaleType(int)
public int getFitToNumPagesTall()
PrintScaleType
property is set to SCALE_TO_FIT_PAGES
.setPrintScaleType(int)
public void setFitToNumPagesWide(int num)
GraphPrinter
.
For example, suppose you have a crosstab that has 20 columns and 10 rows. Suppose that this crosstab would normally print on two sheets of paper, the first 12 columns on page 1 and the remainder on page 2. You could set FitToNumPagesWide
to 1 in order to reduce the printed size of the crosstab so that all 20 columns are printed on one sheet of paper. The view is scaled to fit the number of pages that you specify only when the PrintScaleType
property is set to SCALE_TO_FIT_PAGES
.
num
- The number of pages on which the view should fit horizontally.setPrintScaleType(int)
public int getFitToNumPagesWide()
PrintScaleType
property is set to SCALE_TO_FIT_PAGES
.setPrintScaleType(int)
public void setGridlinesVisible(boolean visible)
GridView
. This method does nothing in a GraphPrinter
.visible
- true
to make gridlines appear in a printed GridView
. false
to hide gridlines.public boolean isGridlinesVisible()
GridView
.true
if gridlines appear in the GridView
when it is printed, false
if they do not appear.public boolean setLogicalPage(int[] hPos)
printPage
method to print. Call this method after you call the startPrint
method for each view that you print.hPos
- The hPos
array that identifies the logical page to print.true
if the logical page has been set, false
if the data in the view is not available to this ViewPrinter
.GraphPrinter.printPage(Graphics)
, CrosstabPrinter.printPage(java.awt.Graphics)
, CrosstabPrinter.printPage(Graphics, DataSubsetRecord)
, TablePrinter.printPage(Graphics)
, TablePrinter.printPage(Graphics, DataSubsetRecord)
, PrintDialog
, DataAccess.getFirstHPos(int)
, DataAccess.getNextHPos(int, int[])
public int[] getLogicalPage()
printPage
method to print.hPos
array that identifies the logical page.GraphPrinter.printPage(Graphics)
, CrosstabPrinter.printPage(java.awt.Graphics)
, CrosstabPrinter.printPage(Graphics, DataSubsetRecord)
, TablePrinter.printPage(Graphics)
, TablePrinter.printPage(Graphics, DataSubsetRecord)
, PrintDialog
, DataAccess.getNextHPos(int, int[])
public void setSelectedHPos(java.util.Vector printHPos)
RangeType
is SELECTED_LOGICAL_PAGES
. Each logical page to print is specified as an HPos
.printHPos
- A Vector
that contains an HPos
for each logical page that you want to print.SELECTED_LOGICAL_PAGES
, setRangeType(int)
, DataAccess.getMemberHPos(int, int, int)
public java.util.Vector getSelectedHPos()
RangeType
is set to SELECTED_LOGICAL_PAGES
.Vector
that contains an HPos
for each logical page to print.SELECTED_LOGICAL_PAGES
, setRangeType(int)
, DataAccess.getMemberHPos(int, int, int)
public void setRangeType(int type)
This method works only when you use the print
method or the renderPage
method to print. To set the page to print when you use the printPage
method to print, call setLogicalPage
.
type
- A constant that identifies how much of the view to print.ALL_LOGICAL_PAGES
, CURRENT_LOGICAL_PAGE
, SELECTED_LOGICAL_PAGES
, setLogicalPage(int[])
public int getRangeType()
ALL_LOGICAL_PAGES
, CURRENT_LOGICAL_PAGE
, SELECTED_LOGICAL_PAGES
public HeaderAndFooterPainter getFooterPainter()
getHeaderAndFooterPainter(int)
HeaderAndFooterPainter
objects for footers. To retrieve a footer, pass FOOTER_LEFT
, FOOTER_CENTER
, or FOOTER_RIGHT
to getHeaderAndFooterPainter
.public HeaderAndFooterPainter getHeaderPainter()
getHeaderAndFooterPainter(int)
HeaderAndFooterPainter
objects for headers. To retrieve a header, pass HEADER_LEFT
, HEADER_CENTER
, or HEADER_RIGHT
to getHeaderAndFooterPainter
.public HeaderAndFooterPainter getHeaderAndFooterPainter(int headerOrFooterID)
headerOrFooterID
- A constant that specifies which header or footer painter you want.HEADER_LEFT
, HEADER_CENTER
, HEADER_RIGHT
, FOOTER_LEFT
, FOOTER_CENTER
, FOOTER_RIGHT
public void setCustomHeaderAndFooterCallback(CustomHeaderAndFooterCallback callback)
ViewPrinter
. Use this method when you have implemented a CustomHeaderAndFooterCallback
, to be able to print different headers and footers on different physical pages of a print job. To specify which headers and footers the callback should be used for, call setHeadersAndFootersUsingCallback
.callback
- The callback that this ViewPrinter
should use for custom headers and footers.setHeadersAndFootersUsingCallback(int)
public CustomHeaderAndFooterCallback getCustomHeaderAndFooterCallback()
ViewPrinter
uses for displaying custom headers and footers.ViewPrinter
uses to print custom headers and footers. If no custom callback has been registered with this ViewPrinter
, then this method returns null
.public void setHeadersAndFootersUsingCallback(int mask)
CustomHeaderAndFooterCallback
, to specify which headers, footers, or both will use the custom callback.mask
- A constant that identifies the header or footer that uses a custom callback. You can combine the constants by using the OR operator (|).HEADER_LEFT
, HEADER_CENTER
, HEADER_RIGHT
, FOOTER_LEFT
, FOOTER_CENTER
, FOOTER_RIGHT
, HEADERS_AND_FOOTERS_ALL
, HEADERS_AND_FOOTERS_NONE
, setCustomHeaderAndFooterCallback(oracle.dss.dataView.CustomHeaderAndFooterCallback)
public int getHeadersAndFootersUsingCallback()
HEADER_LEFT
, HEADER_CENTER
, HEADER_RIGHT
, FOOTER_LEFT
, FOOTER_CENTER
, FOOTER_RIGHT
, setCustomHeaderAndFooterCallback(oracle.dss.dataView.CustomHeaderAndFooterCallback)
public void setMarginAdjustment(int adjustment)
adjustment
- A constant that represents how you want the margin to react to headers and footers that do not fit in the margin.ADJUST_FOR_HEADERS_AND_FOOTERS
, IGNORE_HEADERS_AND_FOOTERS
, OCCLUDE_HEADERS_AND_FOOTERS
public int getMarginAdjustment()
ADJUST_FOR_HEADERS_AND_FOOTERS
, IGNORE_HEADERS_AND_FOOTERS
, OCCLUDE_HEADERS_AND_FOOTERS
public void setViewDimension(java.awt.Dimension dim)
When you call print
to print a view, you do not need to call this method. The ViewPrinter
gets the size of the paper from the print job.
When you call renderPage
to print, then margins are taken out of the Dimension
that you pass in this method. If you want to print on a full sheet of paper, then set the size of the paper in the Dimension
.
If you call printPage
, then the full Dimension
is used to print the view. You should account for margins when you specify the Dimension
.
dim
- The Dimension
that specifies the size of the area that is alloted on the page, for the view.print(boolean)
, renderPage(java.awt.Graphics)
, CrosstabPrinter.printPage(java.awt.Graphics)
, GraphPrinter.printPage(Graphics)
, CrosstabPrinter.printPage(Graphics, DataSubsetRecord)
, TablePrinter.printPage(Graphics)
, TablePrinter.printPage(Graphics, DataSubsetRecord)
public java.awt.Dimension getViewDimension()
Dimension
that specifies the area for the view.public void setPrintByColumns(boolean byColumns)
For example, suppose that you have a table that has 30 rows and 20 columns, and that 15 rows and 10 columns can fit on a printed sheet of paper. When PrintByColumns
is true
(the default), then the pages are printed as follows:
When PrintByColumns
is false
, then the pages are printed as follows:
This method does nothing in a GraphPrinter
.
byRows
- true
if physical pages are printed by columns, false
if physical pages are printed by rows.public boolean isPrintByColumns()
GraphPrinter
.true
if physical pages are printed by columns, false
if physical pages are printed by rows.public java.awt.PrintJob getPrintJob()
PrintJob
object for this ViewPrinter
.PrintJob
object.public Dataview getDataview()
Dataview
that this ViewPrinter
prints.Dataview
that this ViewPrinter
prints.public boolean showPrintJob()
java.awt.Toolkit.DefaultToolkit
. The user can specify the page dimensions in the standard Print dialog box and can accept or cancel the print job.true
if the user presses the OK button in the Print dialog box, false
if the user presses the Cancel button.public void setPrintJob(java.awt.PrintJob job)
PrintJob
to use for printing.job
- The PrintJob
object to use.public boolean renderPage(java.awt.Graphics g)
Graphics
object. Use this method when you want to print to an area less than the full page, or when you want to print more of a view than just one logical page, but not all pages.
For example, you would call this method if you had a linked crosstab and graph, and you wanted to print all the physical pages of one logical page of the crosstab, and then the same logical page of a graph, and then the next logical page of a crosstab, and then that logical page of a graph, and so on.
You should also call this method if you want to print a view and any other object on the same piece of paper.
You also call this method if you provide your own user interface for print preview.
Before you call this method, you must call prepareFirstPage
, which performs initialization for printing.
g
- The Graphics
object onto which to render the page of the view.true
if the page is successfully rendered, false
if the data in the view is not available to this ViewPrinter
.prepareFirstPage(java.awt.Graphics)
, hasNextPage()
, prepareNextPage(java.awt.Graphics)
, hasPrevPage()
, preparePrevPage(java.awt.Graphics)
, isFirstPhysicalPage()
, isLastPhysicalPage()
public abstract boolean isFirstPhysicalPage()
renderPage
method.true
if the current physical page is the first physical page in the current logical page, false
if the current physical page is not the first in the logical page.renderPage(java.awt.Graphics)
public abstract boolean isLastPhysicalPage()
renderPage
method.true
if the current physical page is the last physical page in the current logical page, false
if the current physical page is not the last in the logical page.renderPage(java.awt.Graphics)
public void setSequentialPageNumber(int pageNum)
ViewPrinter
. This ViewPrinter
increments or decrements this page number whenever the ViewPrinter
moves to the next page or to the previous page.
You normally call this method when you print multiple views, and you print the same logical page of each view before moving to the next logical page. After you print the first logical page of the first view, you call getSequentialPageNumber
method of the ViewPrinter
for that view to get the current physical page number. You then pass the return value to the setSequentialPageNumber
method of the second ViewPrinter
.
pageNum
- The page number of the physical page.getSequentialPageNumber()
public int getSequentialPageNumber()
ViewPrinter
has printed.setSequentialPageNumber(int)
public int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex) throws java.awt.print.PrinterException
Dataview
to a Graphics
. The java.awt.print.PrinterJob
class calls this method. Application developers should not need call this method.print
in interface java.awt.print.Printable
graphics
- The context into which the page is drawn.pageFormat
- The size and orientation of the page that is drawn.pageIndex
- The zero-based index of the page to be drawn.java.awt.print.Printable.PAGE_EXISTS
if the page is rendered successfully, java.awt.print.Printable.NO_SUCH_PAGE
if pageIndex
specifies a nonexistent page.public abstract boolean startPrint()
Calling this method is equivalent to calling startPrint(false)
. It is appropriate for printing or previewing graphs, or printing tables and crosstabs. To preview a table or crosstab, call startPrint(true)
.
Calls to the print
method belong between calls to startPrint
and endPrint
.
true
if the print job starts successfully, false
if the data in the view is not available to this ViewPrinter
.endPrint()
, print(boolean)
, renderPage(java.awt.Graphics)
, startPrint(boolean)
, CrosstabPrinter.printPage(java.awt.Graphics)
, GraphPrinter.printPage(Graphics)
, CrosstabPrinter.printPage(Graphics, DataSubsetRecord)
, TablePrinter.printPage(Graphics)
, TablePrinter.printPage(Graphics, DataSubsetRecord)
public abstract boolean startPrint(boolean bPreviewMode)
Use this method, with the renderPage
method, when you preview a table or crosstab. Passing true
in the bPreviewMode
parameter allows this ViewPrinter
to cache information to improve performance.
Calls to the print
method belong between calls to startPrint
and endPrint
.
bPreviewMode
- true
if you are previewing the print job, false
if you are actually sending the print job to a printer.true
if the print job starts successfully, false
if the data in the view is not available to this ViewPrinter
.endPrint()
, print(boolean)
, renderPage(java.awt.Graphics)
, GraphPrinter.printPage(Graphics)
, CrosstabPrinter.printPage(java.awt.Graphics)
, CrosstabPrinter.printPage(Graphics, DataSubsetRecord)
, TablePrinter.printPage(Graphics)
, TablePrinter.printPage(Graphics, DataSubsetRecord)
public abstract void endPrint()
startPrint
method displays, and restores the active display of the view.
Calls to the print
method belong between calls to startPrint
and endPrint
.
startPrint()
, print(boolean)
, renderPage(java.awt.Graphics)
, CrosstabPrinter.printPage(java.awt.Graphics)
, GraphPrinter.printPage(Graphics)
, CrosstabPrinter.printPage(Graphics, DataSubsetRecord)
, TablePrinter.printPage(Graphics)
, TablePrinter.printPage(Graphics, DataSubsetRecord)
public abstract void setRepeatHeaders(boolean repeat)
When RepeatHeaders
is true
, then the title, subtitle, footnote, and paging component are also repeated on each page.
When RepeatHeaders
is false
, then the title, subtitle, and paging component appear only on the first page. The footnote appears only on the last page. The column headers appear only on pages that display the first column, and the row headers appear only on pages that display the first row.
repeat
- true
to repeat row and column headers and titles, false
to prevent repeating.public abstract boolean isRepeatHeaders()
false
in a GraphPrinter
.
When RepeatHeaders
is true
, then the title, subtitle, footnote, and paging component are also repeated on each page.
When RepeatHeaders
is false
, then the title, subtitle, and paging component appear only on the first page. The footnote appears only on the last page. The column headers appear only on pages that display the first column, and the row headers appear only on pages that display the first row.
repeat
- true
if row and column headers and titles appear on each page, false
if they do not.public abstract boolean goToFirstPage()
prepareFirstPage(Graphics)
prepareFirstPage
method respects the MarginAdjustment
property.setMarginAdjustment(int)
public abstract boolean goToNextPage()
prepareNextPage(Graphics)
prepareNextPage
method respects the MarginAdjustment
property.setMarginAdjustment(int)
public abstract boolean goToPrevPage()
preparePrevPage(Graphics)
preparePrevPage
method respects the MarginAdjustment
property.setMarginAdjustment(int)
public abstract boolean prepareFirstPage(java.awt.Graphics g)
renderPage
to print. Call this method before you call any of the other methods for changing pages. Call this method, even if you only print one physical page. This method performs initialization for printing.g
- The Graphics
object to which to print the page.true
if the call is successful, false
if the first physical page has no data.renderPage(java.awt.Graphics)
, hasNextPage()
, prepareNextPage(java.awt.Graphics)
public abstract boolean prepareNextPage(java.awt.Graphics g)
renderPage
to print. Unless you are certain that there is a next page, you should call hasNextPage
before you call this method. Also, before calling this method, call prepareFirstPage
.g
- The Graphics
object to which to print the page.true
if the call is successful, false
if the next physical page has no data.renderPage(java.awt.Graphics)
, prepareFirstPage(java.awt.Graphics)
, hasNextPage()
public abstract void setScaleFontSize(int mask)
mask
- A constant that represents the set of components to scale with the graph. The constants are listed in the See Also section.Graph.TEXT_COMPONENTS_ALL
, Graph.TEXT_COMPONENTS_NONE
public abstract int getScaleFontSize()
Graph.TEXT_COMPONENTS_ALL
, Graph.TEXT_COMPONENTS_NONE
public abstract boolean preparePrevPage(java.awt.Graphics g)
renderPage
to print. Unless you are certain that there is a previous page, you should call hasPrevPage
before you call this method. Also, before calling this method, call prepareFirstPage
.g
- The Graphics
object to which to print the page.true
if the call is successful, false
if the previous physical page has no data.renderPage(java.awt.Graphics)
, prepareFirstPage(java.awt.Graphics)
, hasPrevPage()
public abstract boolean hasNextPage()
renderPage
to print. Call this method before you call prepareNextPage
.true
if the view has another physical page after the current page, false
if the current physical page is the last physical page.renderPage(java.awt.Graphics)
, prepareNextPage(java.awt.Graphics)
public abstract boolean hasPrevPage()
renderPage
to print. Call this method before you call preparePrevPage
.true
if the view has another physical page before the current page, false
if the current physical page is the first physical page.renderPage(java.awt.Graphics)
, preparePrevPage(java.awt.Graphics)
public void setTokenSubstitution(TokenSubstitution token)
ViewPrinter
. Token substitution handlers make it possible for users to insert tokens (such as a token for the current dimension member) in the headers and footers of this ViewPrinter
. This method sets the TokenSubstitution
on this ViewPrinter
and on all six of headers and footers that this ViewPrinter
maintains. By default, the TokenSubstitution
on this ViewPrinter
and on each header and footer is null
. You can also set a TokenSubstitution
on each individual header and footer separately.token
- The token substitution handler for this ViewPrinter
.public void setPageFormat(java.awt.print.PageFormat pf)
PageFormat
object that specifies paper size for this ViewPrinter
. The PageSetupDialog
calls this method to set the PageFormat
object that it modifies, to set the paper size on the print job.pf
- The PageFormat
object that specifies the paper size.public java.awt.print.PageFormat getPageFormat()
PageFormat
object that specifies the paper size for this ViewPrinter
. The PageSetupDialog
calls this method to retrieve the PageFormat
in its initialization. If you use the PageSetupDialog
but not the PrintDialog
, then you should call this method to set the PageFormat
on the PageSetupDialog
.PageFormat
object that specifies the paper size for this ViewPrinter
.public TokenSubstitution getTokenSubstitution()
ViewPrinter
. Token substitution handlers make it possible for users to insert tokens (such as a token for the current dimension member) in the headers and footers of this ViewPrinter
. You can also set a TokenSubstitution
on each individual header and footer separately. This method gets the TokenSubstitution
that is set on this ViewPrinter
, which may be overridden in one or more headers or footers. By default, the TokenSubstitution
on this ViewPrinter
and on each header and footer is null
.ViewPrinter
.
|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |