You use the printPage
method when you want complete control of the print job.
When you use the printPage
method, you have control over the margins, the page
size, headers and footers, and the number of rows and columns to print at a time.
You might want complete control over a print job when you want to print less than a full
logical page of a table or crosstab. For example, suppose that you want to print a range of
cells that the user has selected. You use the printPage
method to specify the rows
and columns to print.
printPage
The following tables lists the methods and their descriptions that are used
with the printPage
method.
View Printer Method |
Description |
---|---|
|
Sets the view for printing. Call before calling any of the other methods in this table. |
|
Specifies the logical page to print. |
|
Specifies the size of the area in which to print the view. |
|
Calculates the number of rows and columns that will fit into the dimension for printing the
view. Call after |
|
Prints the view to a graphics object. |
|
Returns the view to the state it was in before printing. Call after calling the other methods in this table. |
In addition, you use the DataSubsetRecord
object to specify the starting row and
column for the view printer to print to a graphics object, and to get information about the last
row and column that the view printer printed.
The DataSubsetRecord
object stores information about the view
that you are printing. The following table lists the members of the DataSubsetRecord
object and their descriptions.
|
Description |
---|---|
|
You specify the first column to print. |
|
The view printer ( |
|
You specify the first row to print. |
|
The view printer ( |
|
The horizontal position in the view to start printing from. Used when a column is too wide to fit in the specified view dimension. |
|
The horizontal position in the view where printing ended. Used when a column is too wide to fit in the specified view dimension. |
|
You set this to |
You specify the first row and column that you want to print. The calcPageBounds
method of the table printer or crosstab printer stores the last column and the last row. You use
the information about the last row and column in your next call to print
. For
example, to print the next set of columns, you use the same firstRow
value as the
previous call, but you set the firstColumn
member to one plus the value of
lastColumn
.
When a column is too wide to fit in the view dimension that you have specified for printing,
the calcPageBounds
method sets the x2
member to the horizontal position
where printing ended. In the next call, you set the x1
member to the previous value
of x2
.