Package org.eclipse.birt.report.engine.api

# Interface IRenderTask

All Superinterfaces:
  `IEngineTask`

public interface IRenderTask extends IEngineTask
An engine task that renders a Report Document to one of the output formats supported by the engine.

## Field Summary

### Fields inherited from interface org.eclipse.birt.report.engine.api.IEngineTask

`CANCEL_ON_ERROR, CONTINUE_ON_ERROR, STATUS_CANCELLED, STATUS_FAILED, STATUS_NOT_STARTED, STATUS_RUNNING, STATUS_SUCCEEDED, TASK_DATAEXTRACTION, TASK_DATASETPREVIEW, TASK_GETPARAMETERDEFINITION, TASK_RENDER, TASK_RUN, TASK_RUNANDRENDER, TASK_UNKNOWN`

## Method Summary

Modifier and Type
Method
Description
`long`
`getPageCount()`
Gets count of the pages that is output.
`long`
`getPageNumber(String bookmark)`
Given a bookmark in a report, find the (first) page that the bookmark appears in (for hyperlinks to a bookmark)
`IRenderOption`
`getRenderOption()`
`ITOCTree`
`getTOCTree()`
Get the TOC tree
`long`
`getTotalPage()`
`void`
`render()`
render the whole report document or an output format
`void`
`render(long pageNumber)`
Deprecated.
A page with speicfic page number can be rendered like this:
`setPageNumber( pageNumber );`
`render( );`
`void`
`render(String pageRange)`
Deprecated.
A range of pages can be rendered like this:
`setPageRange( pageRange );`
`render( );`
`void`
`render(InstanceID iid)`
Deprecated.
A page which contains the instance can be rendered like this:
`setInstanceID( instanceID );`
`render( );`
`void`
`setBookmark(String bookmark)`
Sets bookmark.
`void`
`setEmitterID(String id)`
sets a specific emitter to use when generate output.
`void`
`setInstanceID(String iid)`
Sets id of instance which is a string type.
`void`
`setInstanceID(InstanceID iid)`
Sets id of instance.
`void`
`setPageHandler(IPageHandler callback)`
set up event handler to be called after each page is generated
`void`
`setPageNumber(long pageNumber)`
Sets number of the page to be rendered.
`void`
`setPageRange(String pageRange)`
Sets range of the pages to be rendered.
`void`
`setRenderOption(IRenderOption options)`
set the rendering options
`void`
`setReportlet(String bookmark)`
Sets reportlet by bookmark.

### Methods inherited from interface org.eclipse.birt.report.engine.api.IEngineTask

`addScriptableJavaObject, cancel, cancel, close, getAppContext, getCancelFlag, getEngine, getErrors, getID, getLocale, getLogger, getParameterDisplayText, getParameterValue, getParameterValues, getReportRunnable, getStatus, getTaskType, getULocale, setAppContext, setDataSource, setDataSource, setErrorHandlingOption, setLocale, setLocale, setLogger, setParameter, setParameter, setParameterDisplayText, setParameterDisplayText, setParameterValue, setParameterValue, setParameterValues, setProgressMonitor, setStatusHandler, setTimeZone, setUserACL, validateParameters`

## Method Details

### setRenderOption

void setRenderOption(IRenderOption options)
set the rendering options

Parameters:
  `settings` - the rendering options

### getRenderOption

IRenderOption getRenderOption()

Returns:
  the render option

### setEmitterID

void setEmitterID(String id)
sets a specific emitter to use when generate output. Used when there are more than one emitters that support a single format. One example is the FO-based PDF emitter and the new PDF emitter added in BIRT2.0. If this function is not called when there are more than 1 emitters that support a format, engine may arbitrarily pick one.

Parameters:
  `id` - the identifier for the emitter

### setPageNumber

void setPageNumber(long pageNumber) throws EngineException
Sets number of the page to be rendered.

Parameters:
  `pageNumber` - number of the page.
Throws:
  `EngineException` - if `pageNumber` is invalid.

### setInstanceID

void setInstanceID(InstanceID iid) throws EngineException
Sets id of instance. If instance id is set, render method will render the page which contains this instance.

Parameters:
  `iid` - id of the instance.
Throws:
  `EngineException` - if `iid` is invalid.

### setInstanceID

void setInstanceID(String iid) throws EngineException
Sets id of instance which is a string type. If instance id is set, render method will render the page which contains this instance.

Parameters:
  `iid` - the string type instance id of the instance.
Throws:
  `EngineException` - if `iid` is invalid.

### setPageRange

void setPageRange(String pageRange) throws EngineException
Sets range of the pages to be rendered.

Parameters:
  `pageRange` - range of the pages.
Throws:
  `EngineException` - if `pageRange` is invalid.

### setBookmark

void setBookmark(String bookmark) throws EngineException
Sets bookmark. If bookmark is set, render method will render the page which contains this bookmark.

Parameters:
  `bookmark` - the bookmark.
Throws:
  `EngineException` - if `bookmark` is invalid.

### setReportlet

void setReportlet(String bookmark) throws EngineException
Sets reportlet by bookmark. The reportlet represented by the bookmark will be render.

Parameters:
  `bookmark` - the bookmark.
Throws:
  `EngineException` - if `bookmark` is invalid.

### render

void render() throws EngineException
render the whole report document or an output format

Throws:
  `EngineException` - if rendering fails

### render

@Deprecated void render(long pageNumber) throws EngineException
Deprecated.
A page with speicfic page number can be rendered like this:
`setPageNumber( pageNumber );`
`render( );`

Parameters:
  `pageNumber` -
Throws:
  `EngineException`

### render

@Deprecated void render(String pageRange) throws EngineException
Deprecated.
A range of pages can be rendered like this:
`setPageRange( pageRange );`
`render( );`
Render the page from startPageNumber to endPageNumber in the Report Doucment to an output format.

Throws:
  `EngineException`

### render

@Deprecated void render(InstanceID iid) throws EngineException
Deprecated.
A page which contains the instance can be rendered like this:
`setInstanceID( instanceID );`
`render( );`
Render the Reportlet whose container is identified by iid. Useful for Reportlet support

Parameters:
  `itemInstanceID` - the report iteminstance to be rendered
Throws:
  `EngineException`

### getPageCount

long getPageCount() throws EngineException
Gets count of the pages that is output. This method can only be invoked after render task is finished otherwise an engine exception will be thrown.

Throws:
  `EngineException`

### getTotalPage

long getTotalPage() throws EngineException

Returns:
  the visible page count in the report.
Throws:
  `EngineException`

### getPageNumber

long getPageNumber(String bookmark) throws EngineException
Given a bookmark in a report, find the (first) page that the bookmark appears in (for hyperlinks to a bookmark)

Parameters:
  `bookmarkName` - bookmark name
Returns:
  the page number that the instance appears first
Throws:
  `EngineException`

### getTOCTree

ITOCTree getTOCTree() throws EngineException
Get the TOC tree

Parameters:
  `format` - the format to generate the report
  `locale` - the locale information to generate the report
Throws:
  `EngineException`

### setPageHandler

void setPageHandler(IPageHandler callback)
set up event handler to be called after each page is generated

Parameters:
  `callback` - a callback function that is called after each checkpoint