Interface IReportContext
public interface IReportContext
An interface used to share information between the event methods in
scripting. Gives access to report parameters and configuration values. Also
provides a way for the report developer to register and retrieve custom
properties.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
cancel the current engine taskvoid
cancel the current engine taskvoid
deleteGlobalVariable
(String name) Remove an object from runtime scope.void
Remove an object from report document scope.evaluate the script with default script language.evaluate the script with specified script language.evaluate
(org.eclipse.birt.report.engine.ir.Expression script) Evaluate the script.Get the application contextget the application classLoader of the current report contextorg.eclipse.birt.report.model.api.ReportDesignHandle
get the report design handle.getGlobalVariable
(String name) Retireve an object from runtime scope.Get the http servlet request objectgetMessage
(String key) Finds user-defined messages for the current thread's locale.getMessage
(String key, Object[] params) Finds user-defined messages for the current thread's locale using parametersgetMessage
(String key, Locale locale) Finds user-defined messages for the given locale.getMessage
(String key, Locale locale, Object[] params) Finds user-defined messages for the given locale using parametersgetPageVariable
(String name) getParameterValue
(String name) Retireve an object from report document scope.org.eclipse.birt.report.engine.api.IRenderOption
get the render options used to render the report.org.eclipse.birt.report.engine.api.IReportRunnable
return the report runnable used to create/render this reportgetResource
(String resourceName) get the URL for the resource.getResourceRenderURL
(String resourceName) get the render URL for a resource.int
Get the type of the current task.com.ibm.icu.util.TimeZone
Get time zone informations.boolean
check if the report document generation is finished.void
setGlobalVariable
(String name, Object obj) Add the object to runtime scope.void
setPageVariable
(String name, Object value) void
setParameterDisplayText
(String name, String value) void
setParameterValue
(String name, Object value) void
setPersistentGlobalVariable
(String name, Serializable obj) Add the object to report document scope.
-
Field Details
-
PAGE_VAR_PAGE_LABEL
- See Also:
-
-
Method Details
-
getReportRunnable
org.eclipse.birt.report.engine.api.IReportRunnable getReportRunnable()return the report runnable used to create/render this report- Returns:
-
getParameterValue
- Parameters:
name
-- Returns:
-
setParameterValue
- Parameters:
name
-value
-
-
getParameterDisplayText
- Parameters:
name
-- Returns:
-
setParameterDisplayText
- Parameters:
name
-value
-
-
getLocale
Locale getLocale()- Returns:
-
getTimeZone
com.ibm.icu.util.TimeZone getTimeZone()Get time zone informations.- Returns:
-
getOutputFormat
String getOutputFormat()- Returns:
-
getRenderOption
org.eclipse.birt.report.engine.api.IRenderOption getRenderOption()get the render options used to render the report.- Returns:
-
getAppContext
Map getAppContext()Get the application context -
getHttpServletRequest
Object getHttpServletRequest()Get the http servlet request object -
setGlobalVariable
Add the object to runtime scope. This object can only be retrieved in the same phase, i.e. it is not persisted between generation and presentation. -
deleteGlobalVariable
Remove an object from runtime scope. -
getGlobalVariable
Retireve an object from runtime scope. -
setPersistentGlobalVariable
Add the object to report document scope. This object can be retrieved later. It is persisted between phases, i.e. between generation and presentation. -
deletePersistentGlobalVariable
Remove an object from report document scope. -
getPersistentGlobalVariable
Retireve an object from report document scope. -
getPageVariable
-
setPageVariable
-
getMessage
Finds user-defined messages for the current thread's locale.- Parameters:
key
- resource key of the user-defined message.- Returns:
- the corresponding locale-dependent messages. Return
null
if resoueceKey is blank.
-
getMessage
Finds user-defined messages for the given locale.First we look up in the report itself, then look into the referenced message file. Each search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
- Parameters:
key
- resource key of the user defined message.locale
- locale of message, if the inputlocale
isnull
, the locale for the current thread will be used instead.- Returns:
- the corresponding locale-dependent messages. Return
null
if resoueceKey is blank.
-
getMessage
Finds user-defined messages for the current thread's locale using parameters- Parameters:
key
- resource key of the user-defined message.params
- string arguments used to format error messages- Returns:
- the corresponding locale-dependent messages. Return
null
if resoueceKey is blank.
-
getMessage
Finds user-defined messages for the given locale using parametersFirst we look up in the report itself, then look into the referenced message file. Each search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
- Parameters:
key
- resource key of the user defined message.locale
- locale of message, if the inputlocale
isnull
, the locale for the current thread will be used instead.params
- string arguments used to format error messages- Returns:
- the corresponding locale-dependent messages. Return
null
if resoueceKey is blank.
-
getTaskType
int getTaskType()Get the type of the current task.- Returns:
- task type including:
- 0 for GetParameterDefinition Task
- 1 for Run Task
- 2 for Render Task
- 3 for Run and Render Task
- 4 for DataExtraction Task
- -1 default value for unknown task
-
getDesignHandle
org.eclipse.birt.report.model.api.ReportDesignHandle getDesignHandle()get the report design handle.- Returns:
- report design handle
-
getResource
get the URL for the resource. The url can only be used in the server side.- Parameters:
resourceName
- resource name- Returns:
- resource URL
-
getResourceRenderURL
get the render URL for a resource.- Parameters:
resourceName
- resource name- Returns:
- the URL which can be used in the client side.
-
evaluate
evaluate the script with default script language.- Parameters:
script
-- Returns:
- Throws:
org.eclipse.birt.core.exception.BirtException
-
evaluate
Object evaluate(String language, String script) throws org.eclipse.birt.core.exception.BirtException evaluate the script with specified script language.- Parameters:
language
-script
-- Returns:
- Throws:
org.eclipse.birt.core.exception.BirtException
-
evaluate
Object evaluate(org.eclipse.birt.report.engine.ir.Expression script) throws org.eclipse.birt.core.exception.BirtException Evaluate the script.- Parameters:
script
-- Returns:
- Throws:
org.eclipse.birt.core.exception.BirtException
-
getApplicationClassLoader
ClassLoader getApplicationClassLoader()get the application classLoader of the current report context- Returns:
- application classLoader
-
cancel
void cancel()cancel the current engine task -
cancel
cancel the current engine task -
isReportDocumentFinished
boolean isReportDocumentFinished()check if the report document generation is finished. It should be used at render time. The default value is false- Returns:
-