com.crystaldecisions.sdk.occa.report.document
Class PrintOptions

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.document.PrintOptions
All Implemented Interfaces:
IPrintOptions, IClone

public class PrintOptions
extends java.lang.Object
implements IPrintOptions, IClone

This object allows you to get and set the print options for a report. This information includes: content height, content width, driver name, page margins, paper orientation, paper size, paper source, port name, printer duplex, and printer name. Use IPrintOptions to access these methods.

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 Microsoft Excel (97-2003), Rich Text Format (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);
 


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.crystaldecisions.sdk.occa.report.document.IPrintOptions
IPrintOptions.PrinterType
 
Constructor Summary
PrintOptions()
           
PrintOptions(IPrintOptions src)
           
 
Method Summary
 java.lang.Object clone(boolean deepClone)
           
 void copyTo(java.lang.Object destObject, boolean deepCopy)
           
 java.lang.Object createMember(java.lang.String eleName, org.xml.sax.Attributes attrs, com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt, java.util.Map objState, boolean[] bLoaded)
           For internal use only.
 void endElement(java.lang.String eleName, java.util.Map objState)
           For internal use only.
 int getContentHeight()
           Gets the report content height.
 int getContentWidth()
           Gets the report content width.
 boolean getDissociatePageSizeAndPrinterPaperSize()
           Gets a value that indicates whether the report page size is dissociated from printer paper sizes.
 java.lang.String getDriverName()
           Gets the driver name.
 IPageMargins getPageMargins()
           Gets the page margins.
 PaperOrientation getPaperOrientation()
           Gets the paper orientation.
 PaperSize getPaperSize()
           Gets the paper size.
 PaperSource getPaperSource()
           Gets the paper source.
 java.lang.String getPortName()
           Gets the port name.
 PrinterDuplex getPrinterDuplex()
           Gets the printer duplex.
 java.lang.String getPrinterName()
           Gets the printer name.
 IPrintOptions.PrinterType getPrinterType()
           Gets the type of a printer
 boolean hasContent(java.lang.Object srcPrintOptions)
           
 void readElement(java.lang.String eleName, java.lang.String sVal, org.xml.sax.Attributes attrs, java.util.Map objState)
           For internal use only.
 void save(XMLWriter writer, java.lang.String sTag, XMLSerializationContext ctxt)
           For internal use only.
 void save(XMLWriter writer, XMLSerializationContext ctxt)
           For internal use only.
 void saveContents(XMLWriter writer, XMLSerializationContext ctxt)
           For internal use only.
 void setContentHeight(int height)
           
 void setContentWidth(int width)
           
 void setDissociatePageSizeAndPrinterPaperSize(boolean bDissociatePageSizeAndPrinterPaperSize)
           Sets a value that indicates whether the report page size is dissociated from printer paper sizes.
 void setDriverName(java.lang.String driverName)
           
 void setPageMargins(IPageMargins pageMargins)
           Sets the page margins.
 void setPaperOrientation(PaperOrientation orientation)
           Sets the paper orientation.
 void setPaperSize(PaperSize size)
           Sets the paper size.
 void setPaperSource(PaperSource source)
           Sets the paper source.
 void setPortName(java.lang.String portName)
           
 void setPrinterDuplex(PrinterDuplex duplex)
           Sets the printer duplex.
 void setPrinterName(java.lang.String printerName)
           Sets the printer name.
 void setPrinterType(IPrintOptions.PrinterType type)
           
 void startElement(java.lang.String eleName, java.util.Map objState, org.xml.sax.Attributes attrs)
           For internal use only.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintOptions

public PrintOptions(IPrintOptions src)

PrintOptions

public PrintOptions()
Method Detail

setContentWidth

public void setContentWidth(int width)

setContentHeight

public void setContentHeight(int height)

setDriverName

public void setDriverName(java.lang.String driverName)

setPortName

public void setPortName(java.lang.String portName)

setPrinterType

public void setPrinterType(IPrintOptions.PrinterType type)

getPrinterType

public IPrintOptions.PrinterType getPrinterType()
Description copied from interface: IPrintOptions

Gets the type of a printer

Specified by:
getPrinterType in interface IPrintOptions
Returns:
a value of the IPrintOptions.PrinterType

getDriverName

public java.lang.String getDriverName()
Description copied from interface: IPrintOptions

Gets the driver name.

Specified by:
getDriverName in interface IPrintOptions
Returns:
the driver name

getPortName

public java.lang.String getPortName()
Description copied from interface: IPrintOptions

Gets the port name.

Specified by:
getPortName in interface IPrintOptions
Returns:
the port name

setPrinterName

public void setPrinterName(java.lang.String printerName)
Description copied from interface: IPrintOptions

Sets the printer name.

Specified by:
setPrinterName in interface IPrintOptions
Parameters:
printerName - the name of the printer to be set

setPageMargins

public void setPageMargins(IPageMargins pageMargins)
Description copied from interface: IPrintOptions

Sets the page margins.

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.

Specified by:
setPageMargins in interface IPrintOptions
Parameters:
pageMargins - the IPageMargins object whose properties will be set

setPaperOrientation

public void setPaperOrientation(PaperOrientation orientation)
Description copied from interface: IPrintOptions

Sets the paper orientation.

Specified by:
setPaperOrientation in interface IPrintOptions
Parameters:
orientation - the PaperOrientation object whose properties will be set

setPaperSize

public void setPaperSize(PaperSize size)
Description copied from interface: IPrintOptions

Sets the paper size.

Specified by:
setPaperSize in interface IPrintOptions
Parameters:
size - the PaperSize object whose properties will be set

setPaperSource

public void setPaperSource(PaperSource source)
Description copied from interface: IPrintOptions

Sets the paper source.

Specified by:
setPaperSource in interface IPrintOptions
Parameters:
source - the PaperSource object whose properties will be set

setPrinterDuplex

public void setPrinterDuplex(PrinterDuplex duplex)
Description copied from interface: IPrintOptions

Sets the printer duplex.

Specified by:
setPrinterDuplex in interface IPrintOptions
Parameters:
duplex - the PrinterDuplex object whose properties will be set

setDissociatePageSizeAndPrinterPaperSize

public void setDissociatePageSizeAndPrinterPaperSize(boolean bDissociatePageSizeAndPrinterPaperSize)
Description copied from interface: IPrintOptions

Sets a value that indicates whether the report page size is dissociated from printer paper sizes. Setting this property to true allows you to control the height and width of the report independent of the paper size specified. This can be useful when the report is viewed electronically, such as on a Web Site. Note: Set to true if using custom page sizes for web-based pagination.

Specified by:
setDissociatePageSizeAndPrinterPaperSize in interface IPrintOptions
Parameters:
bDissociatePageSizeAndPrinterPaperSize - true to dissociate, false otherwise

getPrinterName

public java.lang.String getPrinterName()
Description copied from interface: IPrintOptions

Gets the printer name.

Specified by:
getPrinterName in interface IPrintOptions
Returns:
the printer name

getPageMargins

public IPageMargins getPageMargins()
Description copied from interface: IPrintOptions

Gets the page margins.

Specified by:
getPageMargins in interface IPrintOptions
Returns:
a reference to the IPageMargins object

getContentWidth

public int getContentWidth()
Description copied from interface: IPrintOptions

Gets the report content width.

Specified by:
getContentWidth in interface IPrintOptions
Returns:
the report content width

getContentHeight

public int getContentHeight()
Description copied from interface: IPrintOptions

Gets the report content height.

Specified by:
getContentHeight in interface IPrintOptions
Returns:
the report content height

getPaperOrientation

public PaperOrientation getPaperOrientation()
Description copied from interface: IPrintOptions

Gets the paper orientation.

Specified by:
getPaperOrientation in interface IPrintOptions
Returns:
a reference to the PaperOrientation object

getPaperSize

public PaperSize getPaperSize()
Description copied from interface: IPrintOptions

Gets the paper size.

Specified by:
getPaperSize in interface IPrintOptions
Returns:
a reference to the PaperSize object

getPaperSource

public PaperSource getPaperSource()
Description copied from interface: IPrintOptions

Gets the paper source.

Specified by:
getPaperSource in interface IPrintOptions
Returns:
a reference to the PaperSource object

getPrinterDuplex

public PrinterDuplex getPrinterDuplex()
Description copied from interface: IPrintOptions

Gets the printer duplex.

Specified by:
getPrinterDuplex in interface IPrintOptions
Returns:
a reference to the PrinterDuplex object

getDissociatePageSizeAndPrinterPaperSize

public boolean getDissociatePageSizeAndPrinterPaperSize()
Description copied from interface: IPrintOptions

Gets a value that indicates whether the report page size is dissociated from printer paper sizes.

Specified by:
getDissociatePageSizeAndPrinterPaperSize in interface IPrintOptions
Returns:
True if report page size is dissociated from printer paper sizes, and false otherwise.

clone

public java.lang.Object clone(boolean deepClone)

hasContent

public boolean hasContent(java.lang.Object srcPrintOptions)

copyTo

public void copyTo(java.lang.Object destObject,
                   boolean deepCopy)

createMember

public java.lang.Object createMember(java.lang.String eleName,
                                     org.xml.sax.Attributes attrs,
                                     com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt,
                                     java.util.Map objState,
                                     boolean[] bLoaded)

For internal use only.


readElement

public void readElement(java.lang.String eleName,
                        java.lang.String sVal,
                        org.xml.sax.Attributes attrs,
                        java.util.Map objState)

For internal use only.


save

public void save(XMLWriter writer,
                 XMLSerializationContext ctxt)
          throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

save

public void save(XMLWriter writer,
                 java.lang.String sTag,
                 XMLSerializationContext ctxt)
          throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

saveContents

public void saveContents(XMLWriter writer,
                         XMLSerializationContext ctxt)
                  throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

endElement

public void endElement(java.lang.String eleName,
                       java.util.Map objState)

For internal use only.


startElement

public void startElement(java.lang.String eleName,
                         java.util.Map objState,
                         org.xml.sax.Attributes attrs)

For internal use only.