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 voidaddBoundElement(JRFillElement element, JRPrintElement printElement, JREvaluationTime evaluationTime, FillPageKey pageKey)voidaddFillListener(FillListener fillListener)Adds a fill lister to be notified by events that occur during the fill.protected voidaddLastPageBookmarks()protected voidaddVariableCalculationReq(String variableName, CalculationEnum calculation)Adds a variable calculation request.voidcancelFill()Cancels the fill process.protected voidcheckInterrupted()protected voidclearFillingThread()protected voidcreateBoundElementMaps(JREvaluationTime evaluationTime)protected voiddetectPart()ObjectevaluateExpression(JRExpression expression, byte evaluation)Evaluates an expressionJasperPrintfill(Map<String,Object> parameterValues, Connection conn)JasperPrintfill(Map<String,Object> parameterValues, JRDataSource ds)protected JRFillExpressionEvaluatorgetExpressionEvaluator()JRFillContextgetFillContext()protected FormatFactorygetFormatFactory()Returns the report format factory.JasperPrintgetJasperPrint()JasperReportgetJasperReport()Returns the report.JasperReportsContextgetJasperReportsContext()protected LocalegetLocale()Returns the report locale.JRFillDatasetgetMainDataset()protected BooleangetOwnIgnorePagination(Map<String,Object> parameterValues, boolean onlySetAttribute)protected Map<String,JRFillParameter>getParametersMap()Returns the report parameters indexed by name.ObjectgetParameterValue(String parameterName)Returns the value of a parameter.Map<String,Object>getParameterValuesMap()Returns the map of parameter values.JRPropertiesUtilgetPropertiesUtil()JasperReportSourcegetReportSource()RepositoryContextgetRepositoryContext()protected TimeZonegetTimeZone()Returns the report time zone.intgetUsedPageWidth()JRFillVariablegetVariable(String variableName)Returns a report variable.ObjectgetVariableValue(String variableName)Returns the value of a variable.JRVirtualizationContextgetVirtualizationContext()protected abstract voidignorePaginationSet(Map<String,Object> parameterValues)protected voidinitDatasets()protected abstract JRFillObjectFactoryinitFillFactory()protected voidinitVirtualizationContext(Map<String,Object> parameterValues)protected booleanisDeliberatelyInterrupted()booleanisIgnorePagination()protected booleanisInterrupted()booleanisMasterReport()protected booleanisSubreport()protected abstract voidjasperReportSet()voidrecordUsedPageWidth(int width)protected voidresolveBoundElements(JREvaluationTime evaluationTime, byte evaluation)protected voidresolveMasterBoundElements()protected voidsetBookmarkHelper()protected voidsetConnectionParameterValue(Map<String,Object> parameterValues, Connection conn)protected voidsetDatasourceParameterValue(Map<String,Object> parameterValues, JRDataSource ds)protected voidsetFormatFactory(Map<String,Object> parameterValues)voidsetIgnorePagination(Map<String,Object> parameterValues)protected voidsetInterrupted(boolean isInterrupted)protected voidsetJasperReportsContext(JasperReportsContext jasperReportsContext)protected voidsetParameters(Map<String,Object> parameterValues)protected voidsetParametersToContext(Map<String,Object> parameterValues)protected voidsetVirtualPageSize(Map<String,Object> parameterValues)voidupdateBookmark(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 (JRFillDatasetobjects} 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:
addFillListenerin 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:
fillin 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:
fillin 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:
getFillContextin 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
protected 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 JRExceptionCancels the fill process.- Specified by:
cancelFillin 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()
-
-