Package net.sf.jasperreports.engine.fill
Class BaseReportFiller
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.BaseReportFiller
-
- All Implemented Interfaces:
ReportFiller
- Direct Known Subclasses:
JRBaseFiller
,PartReportFiller
public abstract class BaseReportFiller extends Object implements ReportFiller
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BaseReportFiller(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, FillerParent parent)
BaseReportFiller(JasperReportsContext jasperReportsContext, JasperReport jasperReport, FillerParent parent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addBoundElement(JRFillElement element, JRPrintElement printElement, JREvaluationTime evaluationTime, FillPageKey pageKey)
void
addFillListener(FillListener fillListener)
Adds a fill lister to be notified by events that occur during the fill.protected void
addLastPageBookmarks()
protected void
addVariableCalculationReq(String variableName, CalculationEnum calculation)
Adds a variable calculation request.void
cancelFill()
Cancels the fill process.protected void
checkInterrupted()
protected void
clearFillingThread()
protected void
createBoundElementMaps(JREvaluationTime evaluationTime)
protected void
detectPart()
Object
evaluateExpression(JRExpression expression, byte evaluation)
Evaluates an expressionJasperPrint
fill(Map<String,Object> parameterValues, Connection conn)
JasperPrint
fill(Map<String,Object> parameterValues, JRDataSource ds)
protected JRFillExpressionEvaluator
getExpressionEvaluator()
JRFillContext
getFillContext()
protected FormatFactory
getFormatFactory()
Returns the report format factory.JasperPrint
getJasperPrint()
JasperReport
getJasperReport()
Returns the report.JasperReportsContext
getJasperReportsContext()
Locale
getLocale()
Returns the report locale.JRFillDataset
getMainDataset()
protected Boolean
getOwnIgnorePagination(Map<String,Object> parameterValues, boolean onlySetAttribute)
protected Map<String,JRFillParameter>
getParametersMap()
Returns the report parameters indexed by name.Object
getParameterValue(String parameterName)
Returns the value of a parameter.Map<String,Object>
getParameterValuesMap()
Returns the map of parameter values.JRPropertiesUtil
getPropertiesUtil()
JasperReportSource
getReportSource()
RepositoryContext
getRepositoryContext()
protected TimeZone
getTimeZone()
Returns the report time zone.int
getUsedPageWidth()
JRFillVariable
getVariable(String variableName)
Returns a report variable.Object
getVariableValue(String variableName)
Returns the value of a variable.JRVirtualizationContext
getVirtualizationContext()
protected abstract void
ignorePaginationSet(Map<String,Object> parameterValues)
protected void
initDatasets()
protected abstract JRFillObjectFactory
initFillFactory()
protected void
initVirtualizationContext(Map<String,Object> parameterValues)
protected boolean
isDeliberatelyInterrupted()
boolean
isIgnorePagination()
protected boolean
isInterrupted()
boolean
isMasterReport()
protected boolean
isSubreport()
protected abstract void
jasperReportSet()
void
recordUsedPageWidth(int width)
protected void
resolveBoundElements(JREvaluationTime evaluationTime, byte evaluation)
protected void
resolveMasterBoundElements()
protected void
setBookmarkHelper()
protected void
setConnectionParameterValue(Map<String,Object> parameterValues, Connection conn)
protected void
setDatasourceParameterValue(Map<String,Object> parameterValues, JRDataSource ds)
protected void
setFormatFactory(Map<String,Object> parameterValues)
void
setIgnorePagination(Map<String,Object> parameterValues)
protected void
setInterrupted(boolean isInterrupted)
protected void
setJasperReportsContext(JasperReportsContext jasperReportsContext)
protected void
setParameters(Map<String,Object> parameterValues)
protected void
setParametersToContext(Map<String,Object> parameterValues)
protected void
setVirtualPageSize(Map<String,Object> parameterValues)
void
updateBookmark(JRPrintElement element)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.fill.ReportFiller
fill, isPageFinal
-
-
-
-
Field Detail
-
jasperReportsContext
protected JasperReportsContext jasperReportsContext
-
propertiesUtil
protected JRPropertiesUtil propertiesUtil
-
fillContext
protected JRFillContext fillContext
-
parent
protected FillerParent parent
-
fillerId
protected final int fillerId
-
reportSource
protected JasperReportSource reportSource
-
jasperReport
protected JasperReport jasperReport
The report.
-
repositoryContext
protected RepositoryContext repositoryContext
-
calculator
protected JRCalculator calculator
-
factory
protected final JRFillObjectFactory factory
-
mainDataset
protected JRFillDataset mainDataset
Main report dataset.
-
datasetMap
protected Map<String,JRFillDataset> datasetMap
Map of datasets (JRFillDataset
objects} indexed by name.
-
delayedActions
protected DelayedFillActions delayedActions
-
scriptlet
protected JRAbstractScriptlet scriptlet
-
formatFactory
protected FormatFactory formatFactory
-
ignorePagination
protected boolean ignorePagination
-
bookmarkHelper
protected BookmarkHelper bookmarkHelper
-
virtualizationContext
protected JRVirtualizationContext virtualizationContext
-
jasperPrint
protected JasperPrint jasperPrint
-
fillingThread
protected Thread fillingThread
-
fillListener
protected FillListener fillListener
-
usedPageWidth
protected int usedPageWidth
-
-
Constructor Detail
-
BaseReportFiller
public BaseReportFiller(JasperReportsContext jasperReportsContext, JasperReport jasperReport, FillerParent parent) throws JRException
- Throws:
JRException
-
BaseReportFiller
public BaseReportFiller(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, FillerParent parent) throws JRException
- Throws:
JRException
-
-
Method Detail
-
jasperReportSet
protected abstract void jasperReportSet()
-
initFillFactory
protected abstract JRFillObjectFactory initFillFactory()
-
initDatasets
protected final void initDatasets() throws JRException
- Throws:
JRException
-
createBoundElementMaps
protected final void createBoundElementMaps(JREvaluationTime evaluationTime)
-
addFillListener
public void addFillListener(FillListener fillListener)
Adds a fill lister to be notified by events that occur during the fill.- Specified by:
addFillListener
in interfaceReportFiller
- Parameters:
fillListener
- the listener to add
-
getJasperReportsContext
public JasperReportsContext getJasperReportsContext()
-
getRepositoryContext
public RepositoryContext getRepositoryContext()
-
getPropertiesUtil
public JRPropertiesUtil getPropertiesUtil()
-
getReportSource
public JasperReportSource getReportSource()
-
getJasperReport
public JasperReport getJasperReport()
Returns the report.- Returns:
- the report
-
getJasperPrint
public JasperPrint getJasperPrint()
-
setJasperReportsContext
protected void setJasperReportsContext(JasperReportsContext jasperReportsContext)
-
setParametersToContext
protected final void setParametersToContext(Map<String,Object> parameterValues)
-
initVirtualizationContext
protected void initVirtualizationContext(Map<String,Object> parameterValues)
-
fill
@continuable public JasperPrint fill(Map<String,Object> parameterValues, Connection conn) throws JRException
- Specified by:
fill
in interfaceReportFiller
- Throws:
JRException
-
setConnectionParameterValue
protected void setConnectionParameterValue(Map<String,Object> parameterValues, Connection conn)
-
fill
@continuable public JasperPrint fill(Map<String,Object> parameterValues, JRDataSource ds) throws JRException
- Specified by:
fill
in interfaceReportFiller
- Throws:
JRException
-
setDatasourceParameterValue
protected void setDatasourceParameterValue(Map<String,Object> parameterValues, JRDataSource ds)
-
setParameters
protected void setParameters(Map<String,Object> parameterValues) throws JRException
- Throws:
JRException
-
setBookmarkHelper
protected void setBookmarkHelper()
-
getOwnIgnorePagination
protected Boolean getOwnIgnorePagination(Map<String,Object> parameterValues, boolean onlySetAttribute)
-
ignorePaginationSet
protected abstract void ignorePaginationSet(Map<String,Object> parameterValues)
-
isIgnorePagination
public boolean isIgnorePagination()
-
isInterrupted
protected boolean isInterrupted()
-
isDeliberatelyInterrupted
protected boolean isDeliberatelyInterrupted()
-
setInterrupted
protected void setInterrupted(boolean isInterrupted)
-
checkInterrupted
protected void checkInterrupted()
-
getFillContext
public JRFillContext getFillContext()
- Specified by:
getFillContext
in interfaceReportFiller
-
getVirtualizationContext
public JRVirtualizationContext getVirtualizationContext()
-
getMainDataset
public JRFillDataset getMainDataset()
-
getParameterValuesMap
public Map<String,Object> getParameterValuesMap()
Returns the map of parameter values.- Returns:
- the map of parameter values
-
getParametersMap
protected Map<String,JRFillParameter> getParametersMap()
Returns the report parameters indexed by name.- Returns:
- the report parameters map
-
getParameterValue
public Object getParameterValue(String parameterName)
Returns the value of a parameter.- Parameters:
parameterName
- the parameter name- Returns:
- the parameter value
-
getLocale
public Locale getLocale()
Returns the report locale.- Returns:
- the report locale
-
getTimeZone
protected TimeZone getTimeZone()
Returns the report time zone.- Returns:
- the report time zone
-
addVariableCalculationReq
protected void addVariableCalculationReq(String variableName, CalculationEnum calculation)
Adds a variable calculation request.- Parameters:
variableName
- the variable namecalculation
- the calculation type
-
getVariable
public JRFillVariable getVariable(String variableName)
Returns a report variable.- Parameters:
variableName
- the variable name- Returns:
- the variable
-
getVariableValue
public Object getVariableValue(String variableName)
Returns the value of a variable.- Parameters:
variableName
- the variable name- Returns:
- the variable value
- Throws:
JRRuntimeException
- when the variable does not exist
-
getExpressionEvaluator
protected JRFillExpressionEvaluator getExpressionEvaluator()
-
isSubreport
protected boolean isSubreport()
-
isMasterReport
public boolean isMasterReport()
-
evaluateExpression
public Object evaluateExpression(JRExpression expression, byte evaluation) throws JRException
Evaluates an expression- Parameters:
expression
- the expressionevaluation
- the evaluation type- Returns:
- the evaluation result
- Throws:
JRException
-
getFormatFactory
protected FormatFactory getFormatFactory()
Returns the report format factory.- Returns:
- the report format factory
-
addLastPageBookmarks
protected void addLastPageBookmarks()
-
updateBookmark
public void updateBookmark(JRPrintElement element)
-
detectPart
protected void detectPart()
-
cancelFill
public void cancelFill() throws JRException
Cancels the fill process.- Specified by:
cancelFill
in interfaceReportFiller
- Throws:
JRException
-
clearFillingThread
protected void clearFillingThread()
-
addBoundElement
protected void addBoundElement(JRFillElement element, JRPrintElement printElement, JREvaluationTime evaluationTime, FillPageKey pageKey)
-
resolveBoundElements
protected void resolveBoundElements(JREvaluationTime evaluationTime, byte evaluation) throws JRException
- Throws:
JRException
-
resolveMasterBoundElements
protected void resolveMasterBoundElements() throws JRException
- Throws:
JRException
-
recordUsedPageWidth
public void recordUsedPageWidth(int width)
-
getUsedPageWidth
public int getUsedPageWidth()
-
-