|
|||||||||
| 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)
For internal use only |
java.io.InputStream |
export(IExportOptions exportOptions)
Exports this document to the specified format with options. |
java.io.InputStream |
export(IExportOptions exportOptions,
IRequestContext requestContext)
For internal use only |
void |
export(IExportOptions exportOptions,
IRequestContext requestContext,
java.io.OutputStream os)
For internal use only |
java.io.InputStream |
export(ReportExportFormat format)
Exports this document to the specified format. |
void |
export(ReportExportFormat format,
java.io.OutputStream os)
For internal use only |
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. |
java.util.Locale |
getProductLocale()
|
XMLExportFormats |
getSavedXMLExportFormats()
Gets a collection of all the available XML export format types saved in the report. |
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 contexts)
For internal use only |
void |
printReport(java.awt.print.PrinterJob job,
java.util.List contexts,
PrintReportOptions printReportOptions)
For internal use only. |
void |
printReport(PrintReportOptions printReportOptions)
Prints a report to a specified printer that is controlled by RAS SDK server-side printing. |
void |
setPageMarginFormula(PageMarginConditionFormulaType pageMarginConditionFormulaType,
IConditionFormula newPageMarginConditionFormula)
Modifies the appropriate properties in the PageMargins object. |
void |
setSavedXMLExportFormats(XMLExportFormats _xmlExportFormats)
For internal use only |
| 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.
ReportSDKExceptionIExportOptions
public java.io.InputStream export(IExportOptions exportOptions,
IRequestContext requestContext)
throws ReportSDKException
ReportSDKException
public void export(ReportExportFormat format,
java.io.OutputStream os)
throws ReportSDKException
ReportSDKException
public void export(IExportOptions exportOptions,
IRequestContext requestContext,
java.io.OutputStream os)
throws ReportSDKException
ReportSDKExceptionpublic static IExportOptions createDefaultExportOptions(ReportExportFormat format)
public IPrintOptions getPrintOptions()
throws ReportSDKException
Gets the print options.
IPrintOptions
object
ReportSDKException
public XMLExportFormats getSavedXMLExportFormats()
throws ReportSDKException
Gets a collection of all the available XML export format types saved in the report.
Use this method to get an XMLExportFormats collection.
Each XMLExportFormat object in the collection represents an XML format saved in the report that the
report can be exported to. The XMLExportFormats collection can be iterated through to provide the user
with a list of names or descriptions of all the XML export formats. The report can be programmatically exported to
one of these formats using the PrintOutputController.Export method.
See XMLExportFormatOptions class for
a code example of how to export a report to an XML format.
ReportSDKPrinterException
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 setPageMarginFormula(PageMarginConditionFormulaType pageMarginConditionFormulaType,
IConditionFormula newPageMarginConditionFormula)
throws ReportSDKException
Modifies the appropriate properties in the PageMargins object.
All properties modified in this method are measured in twips.
Example:
This sample shows how to set a page margin condition formula. The formula checks whether a page number is even or odd and sets the margins accordingly: if the page is an even number, the margin is set to one inch; if the page is an odd number, the margin is set to two inches. The formula is applied to the left margin of the report. For more information on the syntax of conditional formulas please refer to Crystal Reports Online Help.
Use this method if you want to modify only the page margin formulas of a report.
For an alternate method see setPageMarginConditionFormulas.
PrintOutputController printOutputController = clientDoc.getPrintOutputController();
IConditionFormula condFormula = new ConditionFormula();
String formulaText = "If Remainder(pagenumber,2) = 0 then 1440 else 2880";
condFormula.setSyntax(FormulaSyntax.crystal);
condFormula.setText(formulaText);
printOutputController.setPageMarginFormula(PageMarginConditionFormulaType.left, condFormula);
Note: There are 1440 twips in an inch.
pageMarginConditionFormulaType - specifies the margin that the formula will be applied to.newPageMarginConditionFormula - the page margin formula.
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 contexts)
throws ReportSDKPrinterException
ReportSDKPrinterException
public void printReport(java.awt.print.PrinterJob job,
java.util.List contexts,
PrintReportOptions printReportOptions)
throws ReportSDKPrinterException
For internal use only.
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
public void setSavedXMLExportFormats(XMLExportFormats _xmlExportFormats)
throws ReportSDKException
ReportSDKExceptionpublic java.util.Locale getProductLocale()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||