Package net.sf.jasperreports.engine.fill
Class JRBaseFiller
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.BaseReportFiller
-
- net.sf.jasperreports.engine.fill.JRBaseFiller
-
- All Implemented Interfaces:
ReportFiller
,JRDefaultStyleProvider
- Direct Known Subclasses:
JRHorizontalFiller
,JRVerticalFiller
public abstract class JRBaseFiller extends BaseReportFiller implements JRDefaultStyleProvider
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
JRBaseFiller.DefaultStyleListener
-
Field Summary
-
Fields inherited from class net.sf.jasperreports.engine.fill.BaseReportFiller
bookmarkHelper, calculator, datasetMap, delayedActions, factory, fillContext, fillerId, fillingThread, fillListener, formatFactory, ignorePagination, jasperPrint, jasperReport, jasperReportsContext, mainDataset, parent, printTransferPropertyPrefixes, propertiesUtil, reportSource, repositoryContext, scriptlet, usedPageWidth, virtualizationContext
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRBaseFiller(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, BandReportFillerParent parent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addBoundElement(JRFillElement element, JRPrintElement printElement, JREvaluationTime evaluationTime)
void
addBoundElement(JRFillElement element, JRPrintElement printElement, EvaluationTimeEnum evaluationType, String groupName, JRFillBand band)
void
addBoundElement(JRFillElement element, JRPrintElement printElement, EvaluationTimeEnum evaluationType, JRGroup group, JRFillBand band)
protected void
addDefaultStyleListener(JRBaseFiller.DefaultStyleListener listener)
protected void
addPage(JRPrintPage page)
protected void
addPageToParent(boolean ended)
void
addPrintStyle(JRStyle style)
protected PrintElementOriginator
assignElementId(JRFillElement fillElement)
protected void
collectIncludedTemplates(ReportTemplateSource templateSource, List<JRStyle> externalStyles, Set<String> loadedLocations, Set<String> templateParentLocations)
protected List<JRStyle>
collectStyles()
protected void
collectStyles(ReportTemplateSource template, List<JRStyle> externalStyles, Set<String> loadedLocations)
protected void
collectStyles(ReportTemplateSource templateSource, List<JRStyle> externalStyles, Set<String> loadedLocations, Set<String> templateParentLocations)
protected void
collectTemplates()
protected List<JRStyle>
collectTemplateStyles()
protected void
createReportTemplates(JRFillObjectFactory factory)
protected int
currentPageIndex()
JasperPrint
fill(Map<String,Object> parameterValues)
protected void
fillBand(JRPrintBand band)
protected abstract void
fillReport()
protected BandReportFillerParent
getBandReportParent()
JRPrintPage
getCurrentPage()
protected int
getCurrentPageContentsWidth()
int
getCurrentPageCount()
Returns the number of generated master print pages.Format
getDateFormat(String pattern)
protected Format
getDateFormat(String pattern, TimeZone timeZone)
JRStyle
getDefaultStyle()
Returns a default style.protected JRFillField
getField(String fieldName)
Returns a report field.protected Map<String,JRFillField>
getFieldsMap()
Returns the report fields indexed by name.protected int
getFillerId()
protected JRFillGroup
getGroup(String groupName)
protected JRFillGroup
getKeepTogetherGroup()
protected int
getMasterColumnCount()
BaseReportFiller
getMasterFiller()
Returns the top-level (master) filler object.protected int
getMaxPageHeight(Map<String,Object> parameterValues)
protected int
getMaxPageWidth(Map<String,Object> parameterValues)
Format
getNumberFormat(String pattern)
protected List<String>
getPrintTransferPropertyPrefixes()
protected ResourceBundle
getResourceBundle()
Returns the report resource bundle.JRStyledTextParser
getStyledTextParser()
protected JRStyledTextUtil
getStyledTextUtil()
StyleResolver
getStyleResolver()
Returns a style resolver.List<JRTemplate>
getTemplates()
protected Map<String,JRFillVariable>
getVariablesMap()
Returns the report variables indexed by name.protected WhenNoDataTypeEnum
getWhenNoDataType()
protected WhenResourceMissingTypeEnum
getWhenResourceMissingType()
protected boolean
hasBoundActions(JRPrintPage page)
protected boolean
hasMasterFormatFactory()
protected boolean
hasMasterLocale()
protected boolean
hasMasterTimeZone()
protected void
ignorePaginationSet(Map<String,Object> parameterValues)
protected JRFillObjectFactory
initFillFactory()
protected boolean
isBandOverFlowAllowed()
protected boolean
isLegacyTextMeasuring()
Deprecated.To be removed.boolean
isPageFinal(int pageIdx)
boolean
isPageFinal(JRPrintPage page)
protected boolean
isReorderBandElements()
protected boolean
isSubreportRunToBottom()
protected void
jasperReportSet()
protected void
loadStyles()
protected void
lookupExternalDefaultStyle(Collection<JRStyle> styleList)
protected void
moveBoundActions(FillPageKey subreportKey, FillPageKey parentKey)
protected JRPrintPage
newPage()
protected boolean
next()
protected void
recordUsedPageHeight(int pageHeight)
protected void
recordUsedWidth(JRPrintElement element)
void
registerReportStyles(UUID id, List<JRStyle> styles)
protected void
registerSubfiller(JRBaseFiller subfiller)
protected void
resolveBandBoundElements(JRFillBand band, byte evaluation)
Resloves elements which are to be evaluated at band level.protected void
resolveColumnBoundElements(byte evaluation)
Resolves elements which are to be evaluated at column level.protected void
resolveGroupBoundElements(byte evaluation, boolean isFinal)
Resolves elements which are to be evaluated at group level.protected void
resolvePageBoundElements(byte evaluation)
Resolves elements which are to be evaluated at page level.protected void
resolveReportBoundElements()
Resolves elements which are to be evaluated at report level.protected void
setBandOverFlowAllowed(boolean splittableBand)
protected void
setDefaultStyle(JRStyle style)
protected void
setJasperReportsContext(JasperReportsContext jasperReportsContext)
protected void
setMasterPageVariables(int currentPageIndex, int totalPages)
protected abstract void
setPageHeight(int pageHeight)
protected void
setParameter(String parameterName, Object value)
Sets a parameter's value.protected void
setParameter(JRFillParameter parameter, Object value)
Sets a parameter's value.protected void
setReorderBandElements(boolean isReorderBandElements)
protected void
subreportPageFilled(JRPrintPage subreportPage)
protected void
unregisterSubfiller(JRBaseFiller subfiller)
-
Methods inherited from class net.sf.jasperreports.engine.fill.BaseReportFiller
addBoundElement, addFillListener, addLastPageBookmarks, addVariableCalculationReq, cancelFill, checkInterrupted, clearFillingThread, createBoundElementMaps, detectPart, evaluateExpression, fill, fill, getExpressionEvaluator, getFillContext, getFormatFactory, getJasperPrint, getJasperReport, getJasperReportsContext, getLocale, getMainDataset, getOwnIgnorePagination, getParametersMap, getParameterValue, getParameterValuesMap, getPropertiesUtil, getReportSource, getRepositoryContext, getTimeZone, getUsedPageWidth, getVariable, getVariableValue, getVirtualizationContext, initDatasets, initVirtualizationContext, isDeliberatelyInterrupted, isIgnorePagination, isInterrupted, isMasterReport, isSubreport, recordUsedPageWidth, resolveBoundElements, resolveMasterBoundElements, setBookmarkHelper, setConnectionParameterValue, setDatasourceParameterValue, setFormatFactory, setIgnorePagination, setInterrupted, setParameters, setParametersToContext, setVirtualPageSize, updateBookmark
-
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_INFINITE_LOOP_CREATING_NEW_PAGE
public static final String EXCEPTION_MESSAGE_KEY_INFINITE_LOOP_CREATING_NEW_PAGE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_COLUMN_HEADER_OVERFLOW_INFINITE_LOOP
public static final String EXCEPTION_MESSAGE_KEY_COLUMN_HEADER_OVERFLOW_INFINITE_LOOP
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_CIRCULAR_DEPENDENCY_FOUND
public static final String EXCEPTION_MESSAGE_KEY_CIRCULAR_DEPENDENCY_FOUND
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_EXTERNAL_STYLE_NAME_NOT_SET
public static final String EXCEPTION_MESSAGE_KEY_EXTERNAL_STYLE_NAME_NOT_SET
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_NO_SUCH_GROUP
public static final String EXCEPTION_MESSAGE_KEY_NO_SUCH_GROUP
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_PAGE_HEADER_OVERFLOW_INFINITE_LOOP
public static final String EXCEPTION_MESSAGE_KEY_PAGE_HEADER_OVERFLOW_INFINITE_LOOP
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_UNSUPPORTED_REPORT_SECTION_TYPE
public static final String EXCEPTION_MESSAGE_KEY_UNSUPPORTED_REPORT_SECTION_TYPE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_KEEP_TOGETHER_CONTENT_DOES_NOT_FIT
public static final String EXCEPTION_MESSAGE_KEY_KEEP_TOGETHER_CONTENT_DOES_NOT_FIT
- See Also:
- Constant Field Values
-
name
protected String name
-
columnCount
protected int columnCount
-
printOrder
protected PrintOrderEnum printOrder
-
columnDirection
protected RunDirectionEnum columnDirection
-
pageWidth
protected int pageWidth
-
maxPageWidth
protected int maxPageWidth
-
pageHeight
protected int pageHeight
-
orientation
protected OrientationEnum orientation
-
columnWidth
protected int columnWidth
-
columnSpacing
protected int columnSpacing
-
leftMargin
protected int leftMargin
-
rightMargin
protected int rightMargin
-
topMargin
protected int topMargin
-
bottomMargin
protected int bottomMargin
-
isTitleNewPage
protected boolean isTitleNewPage
-
isSummaryNewPage
protected boolean isSummaryNewPage
-
isSummaryWithPageHeaderAndFooter
protected boolean isSummaryWithPageHeaderAndFooter
-
isFloatColumnFooter
protected boolean isFloatColumnFooter
-
reportTemplates
protected JRFillReportTemplate[] reportTemplates
-
templates
protected List<ReportTemplateSource> templates
-
defaultStyle
protected JRStyle defaultStyle
-
styleResolver
protected StyleResolver styleResolver
-
styles
protected JRStyle[] styles
-
groups
protected JRFillGroup[] groups
-
missingFillSection
protected JRFillSection missingFillSection
-
missingFillBand
protected JRFillBand missingFillBand
-
background
protected JRFillBand background
-
title
protected JRFillBand title
-
pageHeader
protected JRFillBand pageHeader
-
columnHeader
protected JRFillBand columnHeader
-
detailSection
protected JRFillSection detailSection
-
columnFooter
protected JRFillBand columnFooter
-
pageFooter
protected JRFillBand pageFooter
-
lastPageFooter
protected JRFillBand lastPageFooter
-
summary
protected JRFillBand summary
-
noData
protected JRFillBand noData
-
printPage
protected JRPrintPage printPage
-
printPageContentsWidth
protected int printPageContentsWidth
-
bands
protected List<JRBand> bands
List ofJRFillBand
objects containing all bands of the report.
-
subfillers
protected Map<Integer,JRBaseFiller> subfillers
Collection of subfillers
-
groupFooterPositionElementRange
protected GroupFooterElementRange groupFooterPositionElementRange
-
detailElementRange
protected ElementRange detailElementRange
-
orphanGroupFooterDetailElementRange
protected ElementRange orphanGroupFooterDetailElementRange
-
orphanGroupFooterElementRange
protected ElementRange orphanGroupFooterElementRange
-
floatColumnFooterElementRange
protected ElementRange floatColumnFooterElementRange
-
isCreatingNewPage
protected boolean isCreatingNewPage
-
isNewPage
protected boolean isNewPage
-
isNewColumn
protected boolean isNewColumn
-
isFirstPageBand
protected boolean isFirstPageBand
-
isFirstColumnBand
protected boolean isFirstColumnBand
-
isCrtRecordOnPage
protected boolean isCrtRecordOnPage
-
isCrtRecordOnColumn
protected boolean isCrtRecordOnColumn
-
preventOrphanFootersMinLevel
protected Integer preventOrphanFootersMinLevel
-
crtGroupFootersLevel
protected int crtGroupFootersLevel
-
columnIndex
protected int columnIndex
-
offsetX
protected int offsetX
-
offsetY
protected int offsetY
-
columnHeaderOffsetY
protected int columnHeaderOffsetY
-
columnFooterOffsetY
protected int columnFooterOffsetY
-
lastPageColumnFooterOffsetY
protected int lastPageColumnFooterOffsetY
-
isLastPageFooter
protected boolean isLastPageFooter
-
isReorderBandElements
protected boolean isReorderBandElements
-
usedPageHeight
protected int usedPageHeight
-
-
Constructor Detail
-
JRBaseFiller
protected JRBaseFiller(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, BandReportFillerParent parent) throws JRException
- Throws:
JRException
-
-
Method Detail
-
jasperReportSet
protected void jasperReportSet()
- Specified by:
jasperReportSet
in classBaseReportFiller
-
initFillFactory
protected JRFillObjectFactory initFillFactory()
- Specified by:
initFillFactory
in classBaseReportFiller
-
setJasperReportsContext
protected void setJasperReportsContext(JasperReportsContext jasperReportsContext)
- Overrides:
setJasperReportsContext
in classBaseReportFiller
-
getFieldsMap
protected Map<String,JRFillField> getFieldsMap()
Returns the report fields indexed by name.- Returns:
- the report fields map
-
getVariablesMap
protected Map<String,JRFillVariable> getVariablesMap()
Returns the report variables indexed by name.- Returns:
- the report variables map
-
getField
protected JRFillField getField(String fieldName)
Returns a report field.- Parameters:
fieldName
- the field name- Returns:
- the field
-
getBandReportParent
protected BandReportFillerParent getBandReportParent()
-
getStyledTextParser
public JRStyledTextParser getStyledTextParser()
-
getStyledTextUtil
protected JRStyledTextUtil getStyledTextUtil()
-
getCurrentPageCount
public int getCurrentPageCount()
Returns the number of generated master print pages.- Returns:
- the number of generated master print pages
-
getDefaultStyle
public JRStyle getDefaultStyle()
Description copied from interface:JRDefaultStyleProvider
Returns a default style.- Specified by:
getDefaultStyle
in interfaceJRDefaultStyleProvider
-
getStyleResolver
public StyleResolver getStyleResolver()
Description copied from interface:JRDefaultStyleProvider
Returns a style resolver.- Specified by:
getStyleResolver
in interfaceJRDefaultStyleProvider
-
isSubreportRunToBottom
protected boolean isSubreportRunToBottom()
-
getCurrentPage
public JRPrintPage getCurrentPage()
-
getCurrentPageContentsWidth
protected int getCurrentPageContentsWidth()
-
setPageHeight
protected abstract void setPageHeight(int pageHeight)
-
fill
@continuable public JasperPrint fill(Map<String,Object> parameterValues) throws JRException
- Specified by:
fill
in interfaceReportFiller
- Throws:
JRException
-
addPrintStyle
public void addPrintStyle(JRStyle style) throws JRException
- Throws:
JRException
-
addDefaultStyleListener
protected void addDefaultStyleListener(JRBaseFiller.DefaultStyleListener listener)
-
setDefaultStyle
protected void setDefaultStyle(JRStyle style)
-
loadStyles
protected void loadStyles() throws JRException
- Throws:
JRException
-
collectStyles
protected List<JRStyle> collectStyles() throws JRException
- Throws:
JRException
-
collectTemplates
protected void collectTemplates() throws JRException
- Throws:
JRException
-
getTemplates
public List<JRTemplate> getTemplates()
-
collectTemplateStyles
protected List<JRStyle> collectTemplateStyles() throws JRException
- Throws:
JRException
-
collectStyles
protected void collectStyles(ReportTemplateSource template, List<JRStyle> externalStyles, Set<String> loadedLocations) throws JRException
- Throws:
JRException
-
collectStyles
protected void collectStyles(ReportTemplateSource templateSource, List<JRStyle> externalStyles, Set<String> loadedLocations, Set<String> templateParentLocations) throws JRException
- Throws:
JRException
-
collectIncludedTemplates
protected void collectIncludedTemplates(ReportTemplateSource templateSource, List<JRStyle> externalStyles, Set<String> loadedLocations, Set<String> templateParentLocations) throws JRException
- Throws:
JRException
-
lookupExternalDefaultStyle
protected void lookupExternalDefaultStyle(Collection<JRStyle> styleList)
-
fillReport
@continuable protected abstract void fillReport() throws JRException
- Throws:
JRException
-
ignorePaginationSet
protected void ignorePaginationSet(Map<String,Object> parameterValues)
- Specified by:
ignorePaginationSet
in classBaseReportFiller
-
recordUsedPageHeight
protected void recordUsedPageHeight(int pageHeight)
-
getResourceBundle
protected ResourceBundle getResourceBundle()
Returns the report resource bundle.- Returns:
- the report resource bundle
-
getWhenNoDataType
protected WhenNoDataTypeEnum getWhenNoDataType()
-
hasMasterFormatFactory
protected boolean hasMasterFormatFactory()
-
hasMasterLocale
protected boolean hasMasterLocale()
-
hasMasterTimeZone
protected boolean hasMasterTimeZone()
-
setParameter
protected void setParameter(String parameterName, Object value) throws JRException
Sets a parameter's value.- Parameters:
parameterName
- the parameter namevalue
- the value- Throws:
JRException
-
setParameter
protected void setParameter(JRFillParameter parameter, Object value) throws JRException
Sets a parameter's value.- Parameters:
parameter
- the parametervalue
- the value- Throws:
JRException
-
next
protected boolean next() throws JRException
- Throws:
JRException
-
resolveReportBoundElements
protected void resolveReportBoundElements() throws JRException
Resolves elements which are to be evaluated at report level.- Throws:
JRException
-
resolvePageBoundElements
protected void resolvePageBoundElements(byte evaluation) throws JRException
Resolves elements which are to be evaluated at page level.- Parameters:
evaluation
- the evaluation type- Throws:
JRException
-
resolveColumnBoundElements
protected void resolveColumnBoundElements(byte evaluation) throws JRException
Resolves elements which are to be evaluated at column level.- Parameters:
evaluation
- the evaluation type- Throws:
JRException
-
resolveGroupBoundElements
protected void resolveGroupBoundElements(byte evaluation, boolean isFinal) throws JRException
Resolves elements which are to be evaluated at group level.- Parameters:
evaluation
- the evaluation typeisFinal
-- Throws:
JRException
-
newPage
protected JRPrintPage newPage()
-
resolveBandBoundElements
protected void resolveBandBoundElements(JRFillBand band, byte evaluation) throws JRException
Resloves elements which are to be evaluated at band level.- Parameters:
band
- the bandevaluation
- the evaluation type- Throws:
JRException
-
registerSubfiller
protected void registerSubfiller(JRBaseFiller subfiller)
-
unregisterSubfiller
protected void unregisterSubfiller(JRBaseFiller subfiller)
-
fillBand
protected void fillBand(JRPrintBand band)
-
recordUsedWidth
protected void recordUsedWidth(JRPrintElement element)
-
addPage
protected void addPage(JRPrintPage page)
-
addPageToParent
@continuable protected void addPageToParent(boolean ended) throws JRException
- Throws:
JRException
-
setMasterPageVariables
protected void setMasterPageVariables(int currentPageIndex, int totalPages)
-
getWhenResourceMissingType
protected WhenResourceMissingTypeEnum getWhenResourceMissingType()
-
isBandOverFlowAllowed
protected boolean isBandOverFlowAllowed()
-
setBandOverFlowAllowed
protected void setBandOverFlowAllowed(boolean splittableBand)
-
isReorderBandElements
protected boolean isReorderBandElements()
-
setReorderBandElements
protected void setReorderBandElements(boolean isReorderBandElements)
-
isLegacyTextMeasuring
protected boolean isLegacyTextMeasuring()
Deprecated.To be removed.
-
getMasterColumnCount
protected int getMasterColumnCount()
-
getMasterFiller
public BaseReportFiller getMasterFiller()
Returns the top-level (master) filler object.- Returns:
- the master filler object
-
addBoundElement
public void addBoundElement(JRFillElement element, JRPrintElement printElement, EvaluationTimeEnum evaluationType, String groupName, JRFillBand band)
-
addBoundElement
public void addBoundElement(JRFillElement element, JRPrintElement printElement, EvaluationTimeEnum evaluationType, JRGroup group, JRFillBand band)
-
addBoundElement
protected void addBoundElement(JRFillElement element, JRPrintElement printElement, JREvaluationTime evaluationTime)
-
currentPageIndex
protected int currentPageIndex()
-
subreportPageFilled
protected void subreportPageFilled(JRPrintPage subreportPage)
-
moveBoundActions
protected void moveBoundActions(FillPageKey subreportKey, FillPageKey parentKey)
-
isPageFinal
public boolean isPageFinal(int pageIdx)
- Specified by:
isPageFinal
in interfaceReportFiller
-
isPageFinal
public boolean isPageFinal(JRPrintPage page)
-
hasBoundActions
protected boolean hasBoundActions(JRPrintPage page)
-
getGroup
protected JRFillGroup getGroup(String groupName)
-
getKeepTogetherGroup
protected JRFillGroup getKeepTogetherGroup()
-
createReportTemplates
protected void createReportTemplates(JRFillObjectFactory factory)
-
getFillerId
protected int getFillerId()
-
assignElementId
protected PrintElementOriginator assignElementId(JRFillElement fillElement)
-
-