public class ProcessHtml extends ProcessReport implements ProcessHtmlAPI
ProcessReport.CleanDatasource, ProcessReport.DrillDownTemplate, ProcessReport.PhoneHomeStatsTEMPLATE_TYPE_DOCM, TEMPLATE_TYPE_DOCX, TEMPLATE_TYPE_HTML, TEMPLATE_TYPE_PPTM, TEMPLATE_TYPE_PPTX, TEMPLATE_TYPE_UNKNOWN, TEMPLATE_TYPE_XLSM, TEMPLATE_TYPE_XLSXCSS_EXISTS, CSS_INCLUDE, CSS_NO, CSS_SEPARATE, HTML_2, HTML_4_1, IE5, IE5_5, IE6, XHTMLCHARSET_DEFAULT, CHARSET_RTF, CHARSET_UNICODE, COPY_METADATA_ALWAYS, COPY_METADATA_IF_NO_DATASOURCE, COPY_METADATA_NEVER, DATA_MODE_ALL_ATTRIBUTES, DATA_MODE_DATA, DATA_MODE_EMBED, DATA_MODE_INCLUDE_BITMAPS, DATA_MODE_SELECT, ERROR_HANDLING_ALL, ERROR_HANDLING_NONE, ERROR_HANDLING_TRACK_ERRORS, ERROR_HANDLING_VERIFY, HIDDEN_IGNORE_PRINT_RANGE, HIDDEN_SHOW_ALL_ROWS_COLUMNS, HIDDEN_SHOW_HIDDEN_SHEETS, HIDDEN_SHOW_NO_PRINT, HYPHENATE_OFF, HYPHENATE_ON, HYPHENATE_TEMPLATE, LOCALE_DEFAULT, LOCALE_SYSTEM, RENDER_EXTENT_ALL, RENDER_EXTENT_CROP_CONTENT, RENDER_EXTENT_CROP_MARGINS, TAG_STYLE_CONTROL_2007, TAG_STYLE_FIELD, TAG_STYLE_FIELD_2007, TAG_STYLE_TEXT, TYP_CSV, TYP_DOCX, TYP_HTML, TYP_IMAGE, TYP_PDF, TYP_PPTX, TYP_PRINTER, TYP_PS, TYP_RTF, TYP_TXT, TYP_XLSX| Constructor and Description |
|---|
ProcessHtml(java.io.InputStream template)
Create a ProcessHtml object with the passed in template.
|
ProcessHtml(java.io.InputStream template,
java.util.ArrayList<java.io.ByteArrayOutputStream> reportPages)
Create a ProcessHtml object with the passed in template.
|
ProcessHtml(java.io.InputStream xmlData,
java.io.InputStream template,
java.util.ArrayList<java.io.ByteArrayOutputStream> reportPages)
Create a ProcessReport object with the passed in template & data streams.
|
ProcessHtml(java.io.InputStream xmlData,
java.io.InputStream template,
java.io.OutputStream report)
Create a ProcessReport object with the passed in template & data streams, writing it to
the passed in report stream.
|
ProcessHtml(java.io.InputStream template,
java.io.OutputStream report)
Create a ProcessHtml object with the passed in template, writing it to the passed in report stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addImageName(HtmlImage img)
Set a single image name.
|
void |
addImageNames(java.util.ArrayList imgs)
Set several image names.
|
ProcessReportAPIBase |
duplicate(java.io.OutputStream out)
Creates and returns a copy of this object.
|
ProcessHtmlAPI |
duplicate(java.io.OutputStream out,
java.io.OutputStream cssStream)
Creates and returns a copy of this object.
|
java.lang.String |
getCssFilename()
Returns the css filename.
|
java.io.OutputStream |
getCssStream()
Returns the css stream.
|
int |
getCssType()
Returns if the css information will be written to a separate file, as part of the html file,
or skipped (because the file already exists).
|
java.lang.String |
getFilePath()
Get the path that all images will be saved to on the disk.
|
java.lang.String |
getFilePrefix()
Get the prefix that will be part of the filename of all images saved to disk and listed
in the html file.
|
boolean |
getHeadersFooters() |
java.lang.String |
getHtmlPath()
Get the path that all images will be prefixed with in the html file.
|
java.util.ArrayList |
getImageNames()
Get the image names/streams for the images in a report.
|
java.util.ArrayList<java.io.ByteArrayOutputStream> |
getPages()
Get the array of OutputStreams representing each page in this generated HTML document if html.split_pages is set.
|
byte[][] |
getPagesByteArrays()
Get an array of pages where each page is represented by a byte array (for easy file output).
|
int |
getReportType()
Get the report format of the output stream.
|
java.lang.String |
getReportTypeString()
Get the report format of the output as a string.
|
int |
getSpec()
Gets the spec that the produced report must run under.
|
boolean |
getUseTemplatePageWidth() |
boolean |
isEmbedImages()
When set to true, tells the engine to embed all images in the HTML file
instead of using separate image files; more information found on
Wikipedia: http://en.wikipedia.org/wiki/Data_URI_scheme
|
boolean |
isFullFile()
The report can be generated as either a complete html file, or as just the body.
|
boolean |
isHeaders() |
boolean |
isIE()
Returns true if the spec is set to a version of Internet Explorer.
|
boolean |
isPageBasedReport()
true if the generated report is page based.
|
boolean |
isSplitPages()
When set to true, tells the engine to split HTML output into multiple
documents, one for each page of the document.
|
static boolean |
isSplitPagesFromProperties()
Gets html.split_pages property from properties file
Different from isSplitPages() as this is a static method intended for
use before the creation of a ProcessHtml object.
|
void |
process()
Create a report from the input template and datasource(s) streams, writing it to the output (report) stream.
|
void |
setCss(int cssMethod,
java.io.OutputStream cssStream,
java.lang.String cssFileName)
Sets if the css information will be written to a separate file, as part of the html file,
or skipped (because the file already exists).
|
void |
setEmbededDataMode(int mode)
Set the embed data setting.
|
void |
setEmbedImages(boolean setEmbedImages)
When set to true, tells the engine to embed all images in the HTML file
instead of using separate image files; more information found on
Wikipedia: http://en.wikipedia.org/wiki/Data_URI_scheme
|
void |
setFullFile(boolean fullDoc)
The report can be generated as either a complete html file, or as just the body.
|
void |
setHeadersFooters(boolean headerOn)
When set true tells the engine to grab the first header and footer it finds
and places them at the beggining and end of the html document respectivley.
|
void |
setImagePath(java.lang.String file,
java.lang.String html,
java.lang.String prefix)
Set a path that all images will be saved to.
|
void |
setSpec(int spec)
Sets the spec that the produced report must run under.
|
void |
setSplitPages(boolean setSplitPages)
When set to true, tells the engine to split HTML output into multiple
documents, one for each page of the document.
|
void |
setUseTemplatePageWidth(boolean setUsePageWidth)
When set true tells the engine to put the entire page
into a container with margins the same as the template document page width
|
abort, addImportInfo, adjustFontName, adjustFontSize, batchNext, batchSetup, buildSchema, checkTimeout, clean, clean, cleanSelects, cleanSelects, close, findPodsUsed, getBaseDirectory, getCharset, getChartProvider, getChartRenderType, getCompany, getCopyMetadata, getDataMode, getDataStream, getDataWriter, getDebugHandler, getDescription, getDrillDownInfo, getErrorInfo, getEventHandler, getHiddenMode, getHyphenate, getImportInfo, getKeywords, getLocale, getMaxReportPages, getNumPages, getOutputBuilderData, getParameters, getRenderExtent, getRenderPages, getReport, getSubject, getTemplateMetrics, getTemplateMetrics, getTemplateMetrics, getTemplateTypeString, getTemplateVersion, getTimeout, getTitle, getVersion, getVersionMajor, getVersionMinor, getVersionRelease, getWriteTags, hasDatasourcesApplied, init, isCopyEmbeddedObjects, isDebugMode, isIgnoreTags, isLayoutDocument, isPreservePodFraming, isRemoveUnusedFormats, isReportTypeDocx, isReportTypeExcel, isReportTypeOpenXml, isReportTypePpt, isReportTypeWord, isSameOpenXml, isTemplateTypeDOCX, isTemplateTypeOpenXml, isTemplateTypePPTX, isTemplateTypeXLSX, isTrackImports, isUseExternalOutputBuilder, loadTemplate, mergePodItemStyles, performLayout, processComplete, processData, processData, processSetup, processSetup, setBaseDirectory, setCharset, setCopyEmbeddedObjects, setCopyMetadata, setDataMode, setDataStream, setDebugHandler, setDebugMode, setDescription, setDrillDownInfo, setEventHandler, setHiddenMode, setHyphenate, setIgnoreTags, setKeywords, setLayoutDocument, setLocale, setOutputBuilder, setOutputBuilderData, setParameters, setPreservePodFraming, setRemoveUnusedFormats, setRenderExtent, setRenderPages, setSubject, setTemplateVersion, setTimeout, setTitle, setTrackErrors, setTrackImports, setUseExternalOutputBuilder, setWriteTags, shutdown, statLine, updatePodsequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbatchNext, batchSetup, buildSchema, close, findPodsUsed, getBaseDirectory, getCharset, getCopyMetadata, getDataMode, getDataStream, getDescription, getDrillDownInfo, getErrorInfo, getEventHandler, getHiddenMode, getHyphenate, getImportInfo, getKeywords, getLocale, getNumPages, getOutputBuilderData, getParameters, getRenderExtent, getRenderPages, getReport, getSubject, getTemplateVersion, getTimeout, getTitle, getWriteTags, isCopyEmbeddedObjects, isDebugMode, isLayoutDocument, isPreservePodFraming, isRemoveUnusedFormats, isReportTypeExcel, isReportTypeWord, isTrackImports, isUseExternalOutputBuilder, processComplete, processData, processData, processSetup, processSetup, setBaseDirectory, setCharset, setCopyEmbeddedObjects, setCopyMetadata, setDataMode, setDataStream, setDebugMode, setDescription, setDrillDownInfo, setEventHandler, setHiddenMode, setHyphenate, setKeywords, setLayoutDocument, setLocale, setOutputBuilderData, setParameters, setPreservePodFraming, setRemoveUnusedFormats, setRenderExtent, setRenderPages, setSubject, setTemplateVersion, setTimeout, setTitle, setTrackErrors, setTrackImports, setUseExternalOutputBuilder, setWriteTags, updatePodspublic ProcessHtml(java.io.InputStream template)
throws LicenseException,
SetupException
template - The report template.LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.SetupExceptionpublic ProcessHtml(java.io.InputStream template,
java.io.OutputStream report)
throws LicenseException,
SetupException
template - The report template.report - The stream to write the report to.LicenseException - thrown if the license licenseKey check fails. The message will list the license check that failed.java.lang.IllegalArgumentException - thrown if html.split_pages is set;
call ProcessHtml(InputStream, ArrayListSetupExceptionpublic ProcessHtml(java.io.InputStream template,
java.util.ArrayList<java.io.ByteArrayOutputStream> reportPages)
throws LicenseException,
SetupException
template - The report templatereportPages - The array of streams to write pages to.LicenseExceptionSetupExceptionpublic ProcessHtml(java.io.InputStream xmlData,
java.io.InputStream template,
java.io.OutputStream report)
throws java.lang.IllegalArgumentException,
DataConnectionException,
LicenseException,
SetupException
xmlData - The xml data that will be placed into the report where there are xml elements.template - The report template.report - The stream to write the report to.java.lang.IllegalArgumentException - thrown if an illegal argument is given, or if html.split_pages is enabled. If
split_pages is enabled, use ProcessHtml(InputStream, ArrayListDataSourceException - 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.DataConnectionExceptionSetupExceptionpublic ProcessHtml(java.io.InputStream xmlData,
java.io.InputStream template,
java.util.ArrayList<java.io.ByteArrayOutputStream> reportPages)
throws DataConnectionException,
LicenseException,
SetupException
xmlData - The xml data that will be placed into the report where there are xml elements.template - The report templatereportPages - The array of streams to write pages to.DataConnectionException - 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.SetupExceptionpublic ProcessReportAPIBase duplicate(java.io.OutputStream out) throws AlreadyProcessedException, LicenseException, SetupException
duplicate in interface ProcessReportAPIBaseout - The stream to write the report to. If null will create a ByteArrayOutputStream.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.SetupExceptionpublic ProcessHtmlAPI duplicate(java.io.OutputStream out, java.io.OutputStream cssStream) throws AlreadyProcessedException, LicenseException, SetupException
duplicate in interface ProcessHtmlAPIout - The stream to write the report to. If null will create a ByteArrayOutputStream.cssStream - The css stream to write to. Can be null.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.SetupExceptionpublic void process()
throws LicenseException,
java.io.IOException,
TemplateParseException,
java.lang.IllegalArgumentException,
TagException,
AlreadyProcessedException,
DataSourceException,
OutputLimitationException,
TinyException
process in interface ProcessReportAPIBaseprocess in class ProcessReportjava.io.IOException - thrown if have problems accessing the xml, template, or report streams.LicenseException - thrown if called too often for the license type.java.lang.IllegalArgumentException - thrown if come across an unknown element type or an illegal reportType value is used.TagException - thrown if there is an unmatched if/while - end. Not thrown in debug mode.AlreadyProcessedException - thrown if call process multiple times on an object.DataSourceException - thrown if there is a problem with the datasource.TemplateParseExceptionOutputLimitationExceptionTinyExceptionpublic void setEmbededDataMode(int mode)
mode - the embed data setting. You can only pass a 0.public boolean isIE()
public boolean isHeaders()
public boolean isPageBasedReport()
isPageBasedReport in interface ProcessReportAPIBaseisPageBasedReport in class ProcessReportpublic int getReportType()
getReportType in interface ProcessHtmlAPIgetReportType in interface ProcessReportAPIBasepublic java.lang.String getReportTypeString()
getReportTypeString in interface ProcessReportAPIBasepublic void addImageName(HtmlImage img)
addImageName in interface ProcessHtmlAPIimg - The image to add to the list of images for this file.java.lang.IllegalArgumentException - Thrown if addImageName(s) already calledpublic void addImageNames(java.util.ArrayList imgs)
addImageNames in interface ProcessHtmlAPIimgs - The images to add to the list of images for this file.java.lang.IllegalArgumentException - Thrown if addImageName(s) already calledpublic void setImagePath(java.lang.String file,
java.lang.String html,
java.lang.String prefix)
setImagePath in interface ProcessHtmlAPIfile - The path of the file on the disk relative to the default directory of your program.html - The path of the file relative to the default directory of the client browser.prefix - The prefix to use when creating the filename. This can be null.java.lang.IllegalArgumentException - Thrown if addImageName(s) already calledpublic java.lang.String getFilePath()
getFilePath in interface ProcessHtmlAPIpublic java.lang.String getHtmlPath()
getHtmlPath in interface ProcessHtmlAPIpublic java.lang.String getFilePrefix()
getFilePrefix in interface ProcessHtmlAPIpublic java.util.ArrayList getImageNames()
getImageNames in interface ProcessHtmlAPIpublic java.util.ArrayList<java.io.ByteArrayOutputStream> getPages()
public byte[][] getPagesByteArrays()
public void setFullFile(boolean fullDoc)
setFullFile in interface ProcessHtmlAPIfullDoc - Set to true to return a complete html file, false otherwise.public boolean isFullFile()
isFullFile in interface ProcessHtmlAPIpublic void setCss(int cssMethod,
java.io.OutputStream cssStream,
java.lang.String cssFileName)
throws java.lang.IllegalArgumentException
setCss in interface ProcessHtmlAPIcssMethod - Must be one of the values CSS_NO, CSS_INCLUDE, CSS_SEPARATE, or CSS_EXISTS.cssStream - The stream to write the css file to. This can (and must) only be set if cssMethod
is CSS_SEPARATE. This file will always be the same every time a given template is run so it can be
generated the first time and just reused without being regenerated after that.cssFileName - The name of the file when cssMethod is CSS_SEPARATE or CSS_EXISTS. This is
only needed if the report will write the full file. Set to "" or null for other methods.java.lang.IllegalArgumentException - Thrown if an illegal reportType value is passed in.public int getCssType()
getCssType in interface ProcessHtmlAPIpublic java.lang.String getCssFilename()
getCssFilename in interface ProcessHtmlAPIpublic java.io.OutputStream getCssStream()
getCssStream in interface ProcessHtmlAPIpublic void setSpec(int spec)
throws java.lang.IllegalArgumentException
setSpec in interface ProcessHtmlAPIspec - Must be one of the spec final int's from this class: HTML*, NN*, IE*, ...java.lang.IllegalArgumentException - Thrown if an illegal spec value is passed in.public int getSpec()
getSpec in interface ProcessHtmlAPIpublic void setHeadersFooters(boolean headerOn)
setHeadersFooters in interface ProcessHtmlAPIheaderOn - true=on false=off, off by defaultpublic boolean getHeadersFooters()
getHeadersFooters in interface ProcessHtmlAPIpublic void setUseTemplatePageWidth(boolean setUsePageWidth)
setUseTemplatePageWidth in interface ProcessHtmlAPIsetUsePageWidth - true=on false=off, on by defaultpublic boolean getUseTemplatePageWidth()
getUseTemplatePageWidth in interface ProcessHtmlAPIpublic boolean isEmbedImages()
isEmbedImages in interface ProcessHtmlAPIpublic void setEmbedImages(boolean setEmbedImages)
setEmbedImages in interface ProcessHtmlAPIsetEmbedImages - true=embed images; false=separate images, on by defaultpublic boolean isSplitPages()
isSplitPages in interface ProcessHtmlAPIpublic static boolean isSplitPagesFromProperties()
public void setSplitPages(boolean setSplitPages)
setSplitPages in interface ProcessHtmlAPIsetSplitPages - true=split pages; false=produce one full documentCopyright © 2017 Windward Reports - All Rights Reserved. We are java reporting software