public class DocumentOutputStream extends java.lang.Object implements DocumentOutput
Engine
results. This work only for monolithic file formats. Not support are:
The Java, HTML, SVG and the old XLS format. Also PDF with fastwebview=true or signature. A typical usage is:
Engine eng = new Engine( Engine.EXPORT_PDF );
eng.setReportFile( "myReport.rpt" );
eng.setDocumentLocation( new DocumentOutputStream( new FileOutputStream( "myReport.pdf" ), true ) );
eng.execute()
Constructor and Description |
---|
DocumentOutputStream(java.io.OutputStream output,
boolean autoClose)
Create a new streamed output for a Engine.
|
Modifier and Type | Method and Description |
---|---|
void |
addFontData(byte[] fontData)
Add the data for an embedded font.
|
void |
addPage(byte[] page)
Add a page/chunk.
|
void |
clear()
Reset this output in the initial state.
|
int |
getFontCount()
Get the count of added fonts.
|
byte[] |
getFontData(int idx)
Get the font data from the given index.
|
byte[] |
getGroupTree()
Get the data of the group tree.
|
int |
getPageCount()
Get the current count of pages.
|
byte[] |
getPageData(int idx)
Get the binary data of a page/chunk.
|
boolean |
isPageLimitExceeded()
Check if the rendering of the report ran into a page limit.
|
void |
setErrorData(byte[] error)
Set error data.
|
void |
setFontData(byte[] fontData,
int idx)
Override the font data with a new version.
|
void |
setGroupTree(byte[] data)
Set the group tree.
|
void |
setPageData(byte[] page,
int idx)
Override/patched an existing page/chunk.
|
void |
setPageLimitExceeded()
Set that a PageLimitException exception occur.
|
void |
setUsingTotalPage()
Set that a total page is used in the report.
|
void |
stop(java.lang.String cause)
The rendering was stopped.
|
public DocumentOutputStream(java.io.OutputStream output, boolean autoClose)
output
- the target outputautoClose
- if the stream should be close on finish or error.public int getPageCount()
getPageCount
in interface DocumentOutput
public void clear()
clear
in interface DocumentOutput
public byte[] getPageData(int idx) throws java.lang.ArrayIndexOutOfBoundsException
getPageData
in interface DocumentOutput
idx
- the index, starts with 1java.lang.ArrayIndexOutOfBoundsException
- if index is out of rangepublic byte[] getGroupTree()
getGroupTree
in interface DocumentOutput
public void addPage(byte[] page) throws java.lang.IllegalStateException
DocumentOutput.getPageCount()
addPage
in interface DocumentOutput
page
- the binary data, never nulljava.lang.IllegalStateException
- if this output is finish or stopped.public void setPageData(byte[] page, int idx) throws java.lang.IllegalStateException
setPageData
in interface DocumentOutput
page
- die binary data, never nullidx
- the index, starts with 1java.lang.IllegalStateException
- if this output is finish or stopped.public void setGroupTree(byte[] data) throws java.lang.IllegalStateException
DocumentOutput.getPageCount()
.setGroupTree
in interface DocumentOutput
data
- the binary data, never null, but can be an empty arrayjava.lang.IllegalStateException
- if this output is finish or stopped.public void setErrorData(byte[] error) throws java.lang.IllegalStateException
setErrorData
in interface DocumentOutput
error
- serialized Exceptionjava.lang.IllegalStateException
- if this output is finish or stopped.public void stop(java.lang.String cause)
stop
in interface DocumentOutput
cause
- an optional messagepublic void addFontData(byte[] fontData) throws java.lang.IllegalStateException
DocumentOutput.getFontCount()
. This method is only used from the Java/C#
output format.addFontData
in interface DocumentOutput
fontData
- binary data in the current protocol format.java.lang.IllegalStateException
- if this output is finish or stopped.public void setFontData(byte[] fontData, int idx) throws java.lang.IllegalStateException
setFontData
in interface DocumentOutput
fontData
- binary data in the current protocol format.idx
- the index, starts with 0java.lang.IllegalStateException
- if this output is finish or stopped.public byte[] getFontData(int idx) throws java.lang.ArrayIndexOutOfBoundsException
getFontData
in interface DocumentOutput
idx
- the index, starts with 0java.lang.ArrayIndexOutOfBoundsException
- if index is out of rangepublic int getFontCount()
getFontCount
in interface DocumentOutput
public void setPageLimitExceeded()
setPageLimitExceeded
in interface DocumentOutput
public boolean isPageLimitExceeded()
isPageLimitExceeded
in interface DocumentOutput
public void setUsingTotalPage()
setUsingTotalPage
in interface DocumentOutput
Copyright © 1999-2020 by i-net software GmbH