|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.crystaldecisions.sdk.occa.report.application.PrintOutputController
public class PrintOutputController
This object is used to export reports to a specific format, such as Microsoft Excel (97-2003), Rich Text Format (RTF), or PDF and to modify various formatting options. It is also used to print a report with RAS SDK server-side printing.
Method Summary | |
---|---|
static IExportOptions |
createDefaultExportOptions(ReportExportFormat format)
Creates default IExportFormatOptions based on the given ReportExportFormat |
java.io.InputStream |
export(IExportOptions exportOptions)
Exports this document to the specified format with options. |
java.io.InputStream |
export(IExportOptions exportOptions,
IRequestContext requestContext)
Exports the specified context of this document to the specified format with options. |
void |
export(IExportOptions exportOptions,
IRequestContext requestContext,
java.io.OutputStream os)
Exports the specified context of this document as the specified format, with the specified options and to the passed OutputStream. |
java.io.InputStream |
export(ReportExportFormat format)
Exports this document to the specified format. |
void |
export(ReportExportFormat format,
java.io.OutputStream os)
Exports this document as the specified format and to the passed OutputStream. |
java.util.List |
findAvailableMediaTrays(java.lang.String printerName)
Gets the list of available java MediaTrays for a give printer name. |
IPrintOptions |
getPrintOptions()
Gets the print options. |
void |
modifyPageMargins(int left,
int right,
int top,
int bottom)
Modifies the appropriate properties in the PageMargins object. |
void |
modifyPaperOrientation(PaperOrientation orientation)
Modifies the paper orientation. |
void |
modifyPrinterName(java.lang.String printerName)
Modifies the printer name. |
void |
modifyPrintOptions(IPrintOptions printOptions)
Modifies the print options. |
void |
modifyUserPaperSize(int height,
int width)
Modifies the custom paper size |
void |
printReport(java.awt.print.PrinterJob job,
java.util.List<IRequestContext> contexts)
Prints a report to a specified printer that is controlled by RAS SDK server-side printing. |
void |
printReport(PrintReportOptions printReportOptions)
Prints a report to a specified printer that is controlled by RAS SDK server-side printing. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.io.InputStream export(ReportExportFormat format) throws ReportSDKException
Exports this document to the specified format.
format
- A ReportExportFormat
object that specifies the export format of
the report.
InputStream
object containing the report document exported to the
specified format.
ReportSDKException
public java.io.InputStream export(IExportOptions exportOptions) throws ReportSDKException
Exports this document to the specified format with options.
exportOptions
- The export options that can be specified in the
IExportOptions
object.
InputStream
object containing the report document exported to the
specified format.
ReportSDKException
IExportOptions
public java.io.InputStream export(IExportOptions exportOptions, IRequestContext requestContext) throws ReportSDKException
Exports the specified context of this document to the specified format with options.
exportOptions
- The export options that can be specified in the
IExportOptions
object.requestContext
- The request context specifying the drill path and/or subreport to
export; null for the main report
InputStream
object containing the report document exported to the
specified format.
ReportSDKException
IExportOptions
public void export(ReportExportFormat format, java.io.OutputStream os) throws ReportSDKException
Exports this document as the specified format and to the passed OutputStream.
format
- A ReportExportFormat
object that specifies the export format of
the report.os
- the OutputStream to export to
ReportSDKException
public void export(IExportOptions exportOptions, IRequestContext requestContext, java.io.OutputStream os) throws ReportSDKException
Exports the specified context of this document as the specified format, with the specified options and to the passed OutputStream.
exportOptions
- The export options that can be specified in the
IExportOptions
object.requestContext
- The request context specifying the drill path and/or subreport to
export; null for the main reportos
- the OutputStream to export to
ReportSDKException
IExportOptions
public static IExportOptions createDefaultExportOptions(ReportExportFormat format)
format
- the format to get the default options forpublic IPrintOptions getPrintOptions() throws ReportSDKException
Gets the print options.
IPrintOptions
object
ReportSDKException
public void modifyPrintOptions(IPrintOptions printOptions) throws ReportSDKException
Modifies the print options.
Note: As of the Report Application Server 12 SDK, the
PrintOutputController.modifyPageMargins
method must be used to set all page margins to the default value 0. Attempts to set all page margins to 0 using the
PrintOutputController.modifyPrintOptions
method are ignored.
Example:
This sample shows how to set the print options for a report with the PrintOutputController. The PrintOutputController enables you to export reports to a specific format, such as Excel, RTF, or PDF, and to modify various formatting options.
PrintOutputController printOutputController = clientDoc.getPrintOutputController();
IPrintOptions printOptions = printOutputController.getPrintOptions();
IPrintOptions newPrintOptions = (PrintOptions)((PrintOptions)printOptions).clone(true);
newPrintOptions.setPaperSize(PaperSize.paperLegal);
newPrintOptions.setPaperOrientation(PaperOrientation.landscape);
printOutputController.modifyPrintOptions(newPrintOptions);
printOptions
- the
IPrintOptions
object to be modified
ReportSDKException
public void modifyPageMargins(int left, int right, int top, int bottom) throws ReportSDKException
Modifies the appropriate properties in the
PageMargins
object. All
properties modified in this method are measured in twips.
left
- the left margin of the reportright
- the right margin of the report. Absolute, not relative to the left property.top
- the top margin of the reportbottom
- the bottom margin of the report. Absolute, not relative to the top property.
ReportSDKException
public void modifyUserPaperSize(int height, int width) throws ReportSDKException
Modifies the custom paper size
height
- the height of the paper. This value must be greater than the distance between the vertical margins.width
- the width of the paper. This value must be greater than the distance between the horizontal margins.
ReportSDKException
public void modifyPrinterName(java.lang.String printerName) throws ReportSDKException
Modifies the printer name.
printerName
- the name of the printer to be modified
ReportSDKException
public void modifyPaperOrientation(PaperOrientation orientation) throws ReportSDKException
Modifies the paper orientation.
orientation
- the
PaperOrientation
object to be modified
ReportSDKException
public java.util.List findAvailableMediaTrays(java.lang.String printerName) throws ReportSDKPrinterException
Gets the list of available java MediaTrays for a give printer name.
printerName
- name of the printer.
ReportSDKPrinterException
public void printReport(java.awt.print.PrinterJob job, java.util.List<IRequestContext> contexts) throws ReportSDKPrinterException, java.util.concurrent.CancellationException
Prints a report to a specified printer that is controlled by RAS SDK server-side printing.
job
- the PrinterJob
to use to print the report.contexts
- the list of contexts to print, null to print the top-level report path
java.util.concurrent.CancellationException
- if the print job was cancelled
ReportSDKPrinterException
public void printReport(PrintReportOptions printReportOptions) throws ReportSDKPrinterException
Prints a report to a specified printer that is controlled by RAS SDK server-side printing.
printReportOptions
- the
PrintReportOptions
of the report to be printed by RAS SDK server-side printing
java.util.concurrent.CancellationException
- if the print job was cancelled
ReportSDKPrinterException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |