com.crystaldecisions.sdk.occa.report.lib
Interface IReportPrinter


public interface IReportPrinter


Method Summary
 void addPrintProgressListener(IPrintProgressListener listener)
          Adds the given PrintProgressListener to the list of registered progress listeners.
 void cancel()
          Cancels the printing of the report.
 ConnectionInfos getDatabaseLogOnInfos()
          Returns the database logon requirements from the IReportSource.
 PrinterDuplex getDuplex()
          Returns whether this ReportPrinter will use one or both sides of the paper.
 java.lang.String getJobTitle()
          Returns the title this ReportPrinter will use for the print job.
 java.util.Locale getLocale()
          Returns the locale for this ReportPrinter.
 int getNCopies()
          Returns the number of copies of the report this ReportPrinter will print.
 PrintReportOptions.PageRange[] getPageRangeLimits()
          Returns the page ranges from the report that this ReportPrinter will print.
 PaperSize getPaperSize()
          Returns the size of the paper this ReportPrinter will use.
 PaperSource getPaperSource()
          Returns which paper source (tray or manual feed, for instance) this ReportPrinter will use.
 Fields<IParameterField> getParameterFields()
          Returns the parameter field value requirements from the IReportSource.
 java.lang.String getPrinterName()
          Returns the name of the printer to be used by this ReportPrinter.
 IReportSource getReportSource()
          Returns the report source for this ReportPrinter.
 java.lang.String getSelectionFormula()
          Returns the record selection formula from the IReportSource.
 java.lang.String getViewTimeSelectionFormula()
          Returns the view-time selection formula from the IReportSource.
 boolean isCollated()
          Returns whether multiple copies of the report will be collated by this ReportPrinter.
 void print()
          Prints the report using whatever options have been specified earlier.
 void print(java.awt.print.PrinterJob job)
          Prints the report using the specified PrinterJob.
 void print(PrintReportOptions options)
          Prints the report using the specified PrintReportOptions.
 void removeAllPrintProgressListeners()
          Removes all print progress listeners.
 void removePrintProgressListener(IPrintProgressListener listener)
          Removes the given PrintProgressListener from the list of registered progress listeners.
 void setCollated(boolean collated)
          Sets whether multiple copies of the report will be collated by this ReportPrinter.
 void setContexts(java.util.List<IRequestContext> contexts)
          Sets a list of contexts that need to be printed.
 void setDatabaseLogOnInfos(ConnectionInfos logons)
          Sets the database logon information for the IReportSource.
 void setDuplex(PrinterDuplex duplex)
          Sets whether this ReportPrinter will use one or both sides of the paper.
 void setJobTitle(java.lang.String jobTitle)
          Sets the title this ReportPrinter will use for the print job.
 void setLocale(java.util.Locale locale)
          Sets the locale for this ReportPrinter.
 void setNCopies(int nCopies)
          Sets the number of copies of the report this ReportPrinter will print.
 void setPageRangeLimits(PrintReportOptions.PageRange pageRange)
          Sets the page range from the report that this ReportPrinter will print.
 void setPageRangeLimits(PrintReportOptions.PageRange[] pageRanges)
          Sets the page ranges from the report that this ReportPrinter will print.
 void setPaperSize(PaperSize paperSize)
          Sets the size of the paper this ReportPrinter will use.
 void setPaperSource(PaperSource paperSource)
          Sets which paper source (tray or manual feed, for instance) this ReportPrinter will use.
 void setParameterFields(Fields<IParameterField> parameters)
          Sets the parameter field values for the IReportSource.
 void setPrinterName(java.lang.String printerName)
          Sets which printer this ReportPrinter will use.
 void setReportSource(IReportSource reportSource)
          Sets the report source for this ReportPrinter.
 void setSelectionFormula(java.lang.String formulaText)
          Sets the record selection formula for the IReportSource.
 void setViewTimeSelectionFormula(java.lang.String formulaText)
          Sets the view-time selection formula for the IReportSource.
 

Method Detail

getReportSource

IReportSource getReportSource()
Returns the report source for this ReportPrinter.

Returns:
the report source, or null if not yet set.

setReportSource

void setReportSource(IReportSource reportSource)
Sets the report source for this ReportPrinter. The report source must be set before the print method is called.

Parameters:
reportSource -

getPrinterName

java.lang.String getPrinterName()
Returns the name of the printer to be used by this ReportPrinter. If null, the default printer will be used.

Returns:
the printer's name, or null.

setPrinterName

void setPrinterName(java.lang.String printerName)
                    throws ReportSDKPrinterException
Sets which printer this ReportPrinter will use. Printer names are platform-dependent.

This method requires Java 1.4 or later.

Parameters:
printerName - the name of the printer to use, or null to use the default printer.
Throws:
ReportSDKPrinterJVMException - if used with Java 1.3.
ReportSDKPrinterNotFoundException - if no printer with the given name can be found.
ReportSDKPrinterException - if anything else goes wrong.

getNCopies

int getNCopies()
Returns the number of copies of the report this ReportPrinter will print.

Returns:
the number of copies.

setNCopies

void setNCopies(int nCopies)
Sets the number of copies of the report this ReportPrinter will print.

Parameters:
nCopies - at least 1.
Throws:
java.lang.IllegalArgumentException - if nCopies is less than 1.

isCollated

boolean isCollated()
Returns whether multiple copies of the report will be collated by this ReportPrinter.

Returns:
true if copies will be collated.

setCollated

void setCollated(boolean collated)
                 throws ReportSDKPrinterException
Sets whether multiple copies of the report will be collated by this ReportPrinter.

This method requires Java 1.4 or later.

Parameters:
collated -
Throws:
ReportSDKPrinterJVMException - if used with Java 1.3.
ReportSDKPrinterException

getDuplex

PrinterDuplex getDuplex()
Returns whether this ReportPrinter will use one or both sides of the paper.

Returns:
the duplex setting.

setDuplex

void setDuplex(PrinterDuplex duplex)
               throws ReportSDKPrinterException
Sets whether this ReportPrinter will use one or both sides of the paper.

This method requires Java 1.4 or later.

Parameters:
duplex -
Throws:
java.lang.NullPointerException - if duplex is null.
ReportSDKPrinterJVMException - if used with Java 1.3.
ReportSDKPrinterException

getPaperSize

PaperSize getPaperSize()
Returns the size of the paper this ReportPrinter will use.

Returns:
the paper size.

setPaperSize

void setPaperSize(PaperSize paperSize)
                  throws ReportSDKPrinterException
Sets the size of the paper this ReportPrinter will use.

This method requires Java 1.4 or later.

Parameters:
paperSize -
Throws:
java.lang.NullPointerException - if paperSize is null.
ReportSDKPrinterJVMException - if used with Java 1.3.
ReportSDKPrinterPaperSizeException - if the paper size has no corresponding javax.print.attribute.standard.MediaSizeName.
ReportSDKPrinterException

getPaperSource

PaperSource getPaperSource()
Returns which paper source (tray or manual feed, for instance) this ReportPrinter will use.

Returns:
the paper source.

setPaperSource

void setPaperSource(PaperSource paperSource)
                    throws ReportSDKPrinterException
Sets which paper source (tray or manual feed, for instance) this ReportPrinter will use.

This method requires Java 1.4 or later.

Parameters:
paperSource -
Throws:
java.lang.NullPointerException - if paperSource is null.
ReportSDKPrinterJVMException - if used with Java 1.3.
ReportSDKPrinterPaperSourceException - if the paper size has no corresponding javax.print.attribute.standard.MediaTray.
ReportSDKPrinterException

getPageRangeLimits

PrintReportOptions.PageRange[] getPageRangeLimits()
Returns the page ranges from the report that this ReportPrinter will print.

Returns:
the page ranges, or null.

setPageRangeLimits

void setPageRangeLimits(PrintReportOptions.PageRange[] pageRanges)
                        throws ReportSDKPrinterException
Sets the page ranges from the report that this ReportPrinter will print. If pageRanges is null or an empty array, all pages will be printed. A zero starting page number is equivalent to 1. A zero ending page number is equivalent to Integer.MAX_VALUE.

This method requires Java 1.4 or later.

Parameters:
pageRanges - an array of PrintReportOptions.PageRanges, or null.
Throws:
ReportSDKPrinterJVMException - if used with Java 1.3.
java.lang.IllegalArgumentException - if a starting or ending page number is less than zero or if a starting page number is bigger than the ending page number.
ReportSDKPrinterException

setPageRangeLimits

void setPageRangeLimits(PrintReportOptions.PageRange pageRange)
                        throws ReportSDKPrinterException
Sets the page range from the report that this ReportPrinter will print. If pageRange is null, all pages will be printed. A zero starting page number is equivalent to 1. A zero ending page number is equivalent to Integer.MAX_VALUE.

This method requires Java 1.4 or later.

Parameters:
pageRange - a PrintReportOptions.PageRange, or null.
Throws:
ReportSDKPrinterJVMException - if used with Java 1.3.
java.lang.IllegalArgumentException - if the starting or ending page number is less than zero or if the starting page number is bigger than the ending page number.
ReportSDKPrinterException

getJobTitle

java.lang.String getJobTitle()
Returns the title this ReportPrinter will use for the print job.

Returns:
the print job title, or null if not yet set.

setJobTitle

void setJobTitle(java.lang.String jobTitle)
Sets the title this ReportPrinter will use for the print job.

Parameters:
jobTitle -

getDatabaseLogOnInfos

ConnectionInfos getDatabaseLogOnInfos()
                                      throws ReportSDKExceptionBase
Returns the database logon requirements from the IReportSource.

Returns:
database logon information, or null.
Throws:
ReportSDKExceptionBase - if the database logon requirements can't be retrieved.

setDatabaseLogOnInfos

void setDatabaseLogOnInfos(ConnectionInfos logons)
Sets the database logon information for the IReportSource.

Parameters:
logons - database logon information.
Throws:
java.lang.IllegalStateException - if the report source has not been set.

getParameterFields

Fields<IParameterField> getParameterFields()
                                           throws ReportSDKExceptionBase
Returns the parameter field value requirements from the IReportSource.

Returns:
the parameter fields, or null.
Throws:
ReportSDKExceptionBase - if the parameter field value requirements can't be retrieved.

setParameterFields

void setParameterFields(Fields<IParameterField> parameters)
Sets the parameter field values for the IReportSource.

Parameters:
parameters - parameter field values.
Throws:
java.lang.IllegalStateException - if the report source has not been set.

getSelectionFormula

java.lang.String getSelectionFormula()
Returns the record selection formula from the IReportSource.

Returns:
the record selection formula, or null.

setSelectionFormula

void setSelectionFormula(java.lang.String formulaText)
Sets the record selection formula for the IReportSource.

Parameters:
formulaText - record selection formula.
Throws:
java.lang.IllegalStateException - if the report source has not been set.

getViewTimeSelectionFormula

java.lang.String getViewTimeSelectionFormula()
Returns the view-time selection formula from the IReportSource.

Returns:
the view-time selection formula, or null.

setViewTimeSelectionFormula

void setViewTimeSelectionFormula(java.lang.String formulaText)
Sets the view-time selection formula for the IReportSource.

Parameters:
formulaText - view-time selection formula.
Throws:
java.lang.IllegalStateException - if the report source has not been set.

getLocale

java.util.Locale getLocale()
Returns the locale for this ReportPrinter.

Returns:
the locale.

setLocale

void setLocale(java.util.Locale locale)
Sets the locale for this ReportPrinter.

Parameters:
locale -
Throws:
java.lang.NullPointerException - if locale is null.

addPrintProgressListener

void addPrintProgressListener(IPrintProgressListener listener)
Adds the given PrintProgressListener to the list of registered progress listeners.

Parameters:
listener - the print progress listener to add.

removePrintProgressListener

void removePrintProgressListener(IPrintProgressListener listener)
Removes the given PrintProgressListener from the list of registered progress listeners.

Parameters:
listener - the print progress listener to remove.

removeAllPrintProgressListeners

void removeAllPrintProgressListeners()
Removes all print progress listeners.


print

void print()
           throws ReportSDKExceptionBase
Prints the report using whatever options have been specified earlier. At a minimum, the report source must be set before this method is called.

Throws:
java.lang.IllegalStateException - if the report source has not yet been set.
ReportSDKExceptionBase - if anything goes wrong.

print

void print(PrintReportOptions options)
           throws ReportSDKExceptionBase
Prints the report using the specified PrintReportOptions. At a minimum, the report source must be set before this method is called.

Note: The paper orientation specified by options is ignored. The orientation defined in the report itself is always used instead.

Some of the PrintReportOptions values require Java 1.4 or later.

Parameters:
options - the print options to use.
Throws:
java.lang.IllegalStateException - if the report source has not yet been set.
ReportSDKPrinterJVMException - if used with Java 1.3 and printer name, collation, duplex, paper size, paper source, or page ranges are specified with values other than the defaults.
ReportSDKExceptionBase - if anything goes wrong.

print

void print(java.awt.print.PrinterJob job)
           throws ReportSDKExceptionBase
Prints the report using the specified PrinterJob. At a minimum, the report source must be set before this method is called.

Parameters:
job - the printer job to use.
Throws:
java.lang.IllegalStateException - if the report source has not yet been set.
ReportSDKExceptionBase - if anything goes wrong.

cancel

void cancel()
            throws ReportSDKExceptionBase
Cancels the printing of the report.

Throws:
ReportSDKExceptionBase - if anything goes wrong.

setContexts

void setContexts(java.util.List<IRequestContext> contexts)
Sets a list of contexts that need to be printed.

Parameters:
contexts - the contexts to print, null for main report.