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 java.lang.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(java.lang.String variableName, CalculationEnum calculation)Adds a variable calculation request.voidcancelFill()Cancels the fill process.protected voidcheckInterrupted()protected voidclearFillingThread()protected voidcreateBoundElementMaps(JREvaluationTime evaluationTime)protected voiddetectPart()java.lang.ObjectevaluateExpression(JRExpression expression, byte evaluation)Evaluates an expressionJasperPrintfill(java.util.Map<java.lang.String,java.lang.Object> parameterValues, java.sql.Connection conn)JasperPrintfill(java.util.Map<java.lang.String,java.lang.Object> parameterValues, JRDataSource ds)protected JRFillExpressionEvaluatorgetExpressionEvaluator()JRFillContextgetFillContext()protected FormatFactorygetFormatFactory()Returns the report format factory.JasperPrintgetJasperPrint()JasperReportgetJasperReport()Returns the report.JasperReportsContextgetJasperReportsContext()protected java.util.LocalegetLocale()Returns the report locale.JRFillDatasetgetMainDataset()protected java.lang.BooleangetOwnIgnorePagination(java.util.Map<java.lang.String,java.lang.Object> parameterValues, boolean onlySetAttribute)protected java.util.Map<java.lang.String,JRFillParameter>getParametersMap()Returns the report parameters indexed by name.java.lang.ObjectgetParameterValue(java.lang.String parameterName)Returns the value of a parameter.java.util.Map<java.lang.String,java.lang.Object>getParameterValuesMap()Returns the map of parameter values.JRPropertiesUtilgetPropertiesUtil()JasperReportSourcegetReportSource()RepositoryContextgetRepositoryContext()protected java.util.TimeZonegetTimeZone()Returns the report time zone.intgetUsedPageWidth()JRFillVariablegetVariable(java.lang.String variableName)Returns a report variable.java.lang.ObjectgetVariableValue(java.lang.String variableName)Returns the value of a variable.JRVirtualizationContextgetVirtualizationContext()protected abstract voidignorePaginationSet(java.util.Map<java.lang.String,java.lang.Object> parameterValues)protected voidinitDatasets()protected abstract JRFillObjectFactoryinitFillFactory()protected voidinitVirtualizationContext(java.util.Map<java.lang.String,java.lang.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(java.util.Map<java.lang.String,java.lang.Object> parameterValues, java.sql.Connection conn)protected voidsetDatasourceParameterValue(java.util.Map<java.lang.String,java.lang.Object> parameterValues, JRDataSource ds)protected voidsetFormatFactory(java.util.Map<java.lang.String,java.lang.Object> parameterValues)voidsetIgnorePagination(java.util.Map<java.lang.String,java.lang.Object> parameterValues)protected voidsetInterrupted(boolean isInterrupted)protected voidsetJasperReportsContext(JasperReportsContext jasperReportsContext)protected voidsetParameters(java.util.Map<java.lang.String,java.lang.Object> parameterValues)protected voidsetParametersToContext(java.util.Map<java.lang.String,java.lang.Object> parameterValues)protected voidsetVirtualPageSize(java.util.Map<java.lang.String,java.lang.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
-
printTransferPropertyPrefixes
protected java.util.List<java.lang.String> printTransferPropertyPrefixes
-
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 java.util.Map<java.lang.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 java.lang.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(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
-
initVirtualizationContext
protected void initVirtualizationContext(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
-
setVirtualPageSize
protected void setVirtualPageSize(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
-
fill
@continuable public JasperPrint fill(java.util.Map<java.lang.String,java.lang.Object> parameterValues, java.sql.Connection conn) throws JRException
- Specified by:
fillin interfaceReportFiller- Throws:
JRException
-
setConnectionParameterValue
protected void setConnectionParameterValue(java.util.Map<java.lang.String,java.lang.Object> parameterValues, java.sql.Connection conn)
-
fill
@continuable public JasperPrint fill(java.util.Map<java.lang.String,java.lang.Object> parameterValues, JRDataSource ds) throws JRException
- Specified by:
fillin interfaceReportFiller- Throws:
JRException
-
setDatasourceParameterValue
protected void setDatasourceParameterValue(java.util.Map<java.lang.String,java.lang.Object> parameterValues, JRDataSource ds)
-
setParameters
protected void setParameters(java.util.Map<java.lang.String,java.lang.Object> parameterValues) throws JRException- Throws:
JRException
-
setBookmarkHelper
protected void setBookmarkHelper()
-
setIgnorePagination
public void setIgnorePagination(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
-
getOwnIgnorePagination
protected java.lang.Boolean getOwnIgnorePagination(java.util.Map<java.lang.String,java.lang.Object> parameterValues, boolean onlySetAttribute)
-
ignorePaginationSet
protected abstract void ignorePaginationSet(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getParameterValuesMap()
Returns the map of parameter values.- Returns:
- the map of parameter values
-
getParametersMap
protected java.util.Map<java.lang.String,JRFillParameter> getParametersMap()
Returns the report parameters indexed by name.- Returns:
- the report parameters map
-
getParameterValue
public java.lang.Object getParameterValue(java.lang.String parameterName)
Returns the value of a parameter.- Parameters:
parameterName- the parameter name- Returns:
- the parameter value
-
getLocale
protected java.util.Locale getLocale()
Returns the report locale.- Returns:
- the report locale
-
getTimeZone
protected java.util.TimeZone getTimeZone()
Returns the report time zone.- Returns:
- the report time zone
-
addVariableCalculationReq
protected void addVariableCalculationReq(java.lang.String variableName, CalculationEnum calculation)Adds a variable calculation request.- Parameters:
variableName- the variable namecalculation- the calculation type
-
getVariable
public JRFillVariable getVariable(java.lang.String variableName)
Returns a report variable.- Parameters:
variableName- the variable name- Returns:
- the variable
-
getVariableValue
public java.lang.Object getVariableValue(java.lang.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 java.lang.Object evaluateExpression(JRExpression expression, byte evaluation) throws JRException
Evaluates an expression- Parameters:
expression- the expressionevaluation- the evaluation type- Returns:
- the evaluation result
- Throws:
JRException
-
setFormatFactory
protected final void setFormatFactory(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
-
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()
-
-