net.windward.xmlreport
Class ProcessRtf

java.lang.Object
  |
  +--net.windward.xmlreport.ProcessReport
        |
        +--net.windward.xmlreport.ProcessRtf
All Implemented Interfaces:
ProcessReportAPI, ProcessReportAPIBase, ProcessRtfAPI

public class ProcessRtf
extends ProcessReport
implements ProcessRtfAPI

This class is the main program that takes a template stream and a datasource and merges them to create a rtf report stream. The way to use this is to construct a ProcessRtf object, set any options, then call process.
The calling method must close all streams after calling process. process will flush the output (report) stream before returning.

Version:
2.0 2 January 2004

Fields inherited from class net.windward.xmlreport.ProcessReport
TEMPLATE_TYPE_DOCX, TEMPLATE_TYPE_RTF, TEMPLATE_TYPE_UNKNOWN, TEMPLATE_TYPE_WORD_11, TEMPLATE_TYPE_XLSX
 
Fields inherited from interface net.windward.xmlreport.ProcessReportAPI
CHARSET_DEFAULT, CHARSET_RTF, CHARSET_UNICODE, LOCALE_DEFAULT, LOCALE_SYSTEM, TYP_DOCX, TYP_EXCEL_ML, TYP_HTML, TYP_PDF, TYP_RTF, TYP_TXT, TYP_WORD_ML, TYP_XLS, TYP_XLSX
 
Constructor Summary
ProcessRtf(java.io.InputStream rtfTemplate)
          Create a ProcessRtf object with the passed in template.
ProcessRtf(java.io.InputStream xmlData, java.io.InputStream rtfTemplate, java.io.OutputStream report)
          Create a ProcessRtf object with the passed in template & data streams, writing it to the passed in report stream.
ProcessRtf(java.io.InputStream rtfTemplate, java.io.OutputStream report)
          Create a ProcessRtf object with the passed in template, writing it to the passed in report stream.
 
Method Summary
 ProcessReportAPIBase duplicate(java.io.OutputStream out)
          Creates and returns a copy of this object.
 int getReportType()
          Get the report format of the output stream.
 boolean isCopyAllTags()
          Get if unknown rtf tags should be copied to the report.
 boolean isExtraPict()
          Get if writes each image twice.
 void setCopyAllTags(boolean copyAllTags)
          Set copy unknown tags mode on or off.
 void setExtraPict(boolean writeTwice)
          Set if writes each image twice.
 
Methods inherited from class net.windward.xmlreport.ProcessReport
addBean, close, dispose, getBaseDirectory, getCharset, getChartProvider, getCompany, getImportingProvider, getInfo, getKeywords, getLocale, getNumPages, getReport, getSubject, getTitle, getVersion, getVersionMajor, getVersionMinor, getVersionRelease, init, isDebugMode, process, processComplete, processData, processSetup, processSetup, setBaseDirectory, setCharset, setChartProvider, setDebugMode, setKeywords, setLocale, setSubject, setTitle, statLine
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.windward.xmlreport.ProcessReportAPI
setChartProvider
 
Methods inherited from interface net.windward.xmlreport.ProcessReportAPIBase
addBean, close, getBaseDirectory, getCharset, getInfo, getKeywords, getLocale, getNumPages, getReport, getSubject, getTitle, isDebugMode, process, processComplete, processData, processSetup, processSetup, setBaseDirectory, setCharset, setDebugMode, setKeywords, setLocale, setSubject, setTitle
 

Constructor Detail

ProcessRtf

public ProcessRtf(java.io.InputStream rtfTemplate)
           throws LicenseException,
                  SetupException
Create a ProcessRtf object with the passed in template. Objects created with this constructor must call processSetup, processData, and processComplete. Objects created with this constructor cannot call process. The report will be in the rtf format.
Parameters:
rtfTemplate - The report template, as a rtf document.
Throws:
LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.

ProcessRtf

public ProcessRtf(java.io.InputStream rtfTemplate,
                  java.io.OutputStream report)
           throws LicenseException,
                  SetupException
Create a ProcessRtf object with the passed in template, writing it to the passed in report stream. Objects created with this constructor must call processSetup, processData, and processComplete. Objects created with this constructor cannot call process. The report will be in the rtf format.
Parameters:
rtfTemplate - The report template, as a rtf document.
report - The stream to write the report to.
Throws:
LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.

ProcessRtf

public ProcessRtf(java.io.InputStream xmlData,
                  java.io.InputStream rtfTemplate,
                  java.io.OutputStream report)
           throws DataSourceException,
                  LicenseException,
                  SetupException
Create a ProcessRtf object with the passed in template & data streams, writing it to the passed in report stream. The report will be in the rtf format.
Parameters:
xmlData - The xml data that will be placed into the report where there are xml elements.
rtfTemplate - The report template, as a rtf document.
report - The stream to write the report to.
Throws:
DataSourceException - thrown if there is a problem with the datasource.
LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.
Method Detail

duplicate

public ProcessReportAPIBase duplicate(java.io.OutputStream out)
                               throws AlreadyProcessedException,
                                      LicenseException,
                                      SetupException
Creates and returns a copy of this object. You may call this before or after calling processData(). You may then call processData() on the created object. You must call this after calling processSetup() and before calling processComplete(). While this mostly does a deep copy, it does not do a deep copy of bean objects or image data. This will always return a ProcessRtf object.
Specified by:
duplicate in interface ProcessReportAPIBase
Parameters:
out - The stream to write the report to. If null will create a ByteArrayOutputStream.
Throws:
AlreadyProcessedException - thrown if call the process steps out of order or call ones other than data twice.
LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.

getReportType

public int getReportType()
Get the report format of the output stream.
Specified by:
getReportType in interface ProcessRtfAPI
Returns:
The type (format) of the output report. Will be TYP_RTF.

setCopyAllTags

public void setCopyAllTags(boolean copyAllTags)
Set copy unknown tags mode on or off. If the copy mode is on, all rtf tags that are understood but not processed will be copied to the report. This will not copy tags that are not understood (or that are understood but cannot be copied stand-alone).
Specified by:
setCopyAllTags in interface ProcessRtfAPI
Parameters:
copyAllTags - Set to true to copy unknown tags.

isCopyAllTags

public boolean isCopyAllTags()
Get if unknown rtf tags should be copied to the report.
Specified by:
isCopyAllTags in interface ProcessRtfAPI
Returns:
true if the unknown tags should be copied.

isExtraPict

public boolean isExtraPict()
Get if writes each image twice. The second time is the image that WordPad uses. Turning this on makes files a lot bigger.
Specified by:
isExtraPict in interface ProcessRtfAPI
Returns:
true if writes the second image copy.

setExtraPict

public void setExtraPict(boolean writeTwice)
Set if writes each image twice. The second time is the image that WordPad uses. Turning this on makes files a lot bigger.
Specified by:
setExtraPict in interface ProcessRtfAPI
Parameters:
writeTwice - true to writes the second image copy.


Copyright © 2002 - 2008 Windward Reports - All Rights Reserved. java reporting software