net.windward.xmlreport
Class ProcessTxt

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

public class ProcessTxt
extends ProcessReport
implements ProcessTxtAPI

This class is the main program that takes a template stream and a datasource and merges them to create a txt report stream. The way to use this is to construct a ProcessRtf object, set any options, then call process.
When writing to this format, all characters are assumed to be 12 point fixed width.
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
ProcessTxt(java.io.InputStream rtfTemplate)
          Create a ProcessTxt object with the passed in template.
ProcessTxt(java.io.InputStream xmlData, java.io.InputStream rtfTemplate, java.io.OutputStream report)
          Create a ProcessReport object with the passed in template & data streams, writing it to the passed in report stream.
ProcessTxt(java.io.InputStream rtfTemplate, java.io.OutputStream report)
          Create a ProcessTxt 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.
 java.lang.String getFont()
          Get the font used when formatting txt output.
 int getFontSize()
          Get the font size used when formatting txt output.
 int getReportType()
          Get the report format of the output stream.
 boolean isBreakPage()
          Returns true if a Ctrl-L is in the report for each page break.
 boolean isShowHeaders()
          Returns true if the header and footers are printed in the report.
 boolean isUseMargins()
          If true, then the left page margin will be included in the output, creating leading spaces for each line.
 void setBreakPage(boolean breakPage)
          Set true if a Ctrl-L is in the report for each page break.
 void setFont(java.lang.String font)
          Set the font used when formatting txt output.
 void setFontSize(int twips)
          Set the font size used when formatting txt output.
 void setShowHeaders(boolean showHeaders)
          Set if the header and footers are printed in the report.
 void setUseMargins(boolean useThem)
          If true, then the left page margin will be included in the output, creating leading spaces for each line.
 
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

ProcessTxt

public ProcessTxt(java.io.InputStream rtfTemplate)
           throws LicenseException,
                  SetupException
Create a ProcessTxt 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.

ProcessTxt

public ProcessTxt(java.io.InputStream rtfTemplate,
                  java.io.OutputStream report)
           throws LicenseException,
                  SetupException
Create a ProcessTxt 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.

ProcessTxt

public ProcessTxt(java.io.InputStream xmlData,
                  java.io.InputStream rtfTemplate,
                  java.io.OutputStream report)
           throws DataSourceException,
                  LicenseException,
                  SetupException
Create a ProcessReport object with the passed in template & data streams, writing it to the passed in report stream. The report will be in the txt 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 ProcessTxt 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 ProcessTxtAPI
Returns:
The type (format) of the output report. Will be TYP_TXT.

isUseMargins

public boolean isUseMargins()
If true, then the left page margin will be included in the output, creating leading spaces for each line. If false, the page margins will be ignored and any paragraph with no left indent will start at the begining of a line. The default is false.
Specified by:
isUseMargins in interface ProcessTxtAPI
Returns:
True if it will include the page margins, false otherwise.

setUseMargins

public void setUseMargins(boolean useThem)
If true, then the left page margin will be included in the output, creating leading spaces for each line. If false, the page margins will be ignored and any paragraph with no left indent will start at the begining of a line. The default is false.
Specified by:
setUseMargins in interface ProcessTxtAPI
Parameters:
useThem - Set to true to include the page margins, false otherwise.

isShowHeaders

public boolean isShowHeaders()
Returns true if the header and footers are printed in the report. False and they will not be printed. The default is false.
Specified by:
isShowHeaders in interface ProcessTxtAPI
Returns:
true if the headers and footers are printed in the final report.

setShowHeaders

public void setShowHeaders(boolean showHeaders)
Set if the header and footers are printed in the report. True to print and false and they will not be printed. The default is false.
Specified by:
setShowHeaders in interface ProcessTxtAPI
Parameters:
showHeaders - true if the headers and footers are printed in the final report.

isBreakPage

public boolean isBreakPage()
Returns true if a Ctrl-L is in the report for each page break. The default is false.
Specified by:
isBreakPage in interface ProcessTxtAPI
Returns:
true if a Ctrl-L is in the report for each page break.

setBreakPage

public void setBreakPage(boolean breakPage)
Set true if a Ctrl-L is in the report for each page break. The default is false.
Specified by:
setBreakPage in interface ProcessTxtAPI
Parameters:
breakPage - true if a Ctrl-L is in the report for each page break.

getFont

public java.lang.String getFont()
Get the font used when formatting txt output. The default is Courier.
Specified by:
getFont in interface ProcessTxtAPI
Returns:
The name of the font used to format txt output.

setFont

public void setFont(java.lang.String font)
Set the font used when formatting txt output. The default is Courier.
Specified by:
setFont in interface ProcessTxtAPI
Parameters:
font - The name of the font used to format txt output.

getFontSize

public int getFontSize()
Get the font size used when formatting txt output. This is set in TWIPS or 20ths of a point. So a value of 240 (the default) is 12 points.
Specified by:
getFontSize in interface ProcessTxtAPI
Returns:
The size of the font used to format txt output in twips.

setFontSize

public void setFontSize(int twips)
Set the font size used when formatting txt output. This is set in TWIPS or 20ths of a point. So a value of 240 (the default) is 12 points.
Specified by:
setFontSize in interface ProcessTxtAPI
Parameters:
twips - The size of the font used to format txt output in twips.


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