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 Details

  • Constructor Details

  • Method Details

    • 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 interface ReportFiller
      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()
    • getDpi

      public int getDpi()
    • 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 interface ReportFiller
      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 interface ReportFiller
      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()
    • setPageBackcolor

      protected void setPageBackcolor()
      Sets the page background color of the generated document from the JasperPrint.PROPERTY_PAGE_BACKCOLOR property of the report.

      This happens before the first page is produced, because parts copy the page format of the document when their first page is added, and again after the report level property expressions are evaluated.

    • updateDetectedParts

      protected void updateDetectedParts()
      Recreates the parts detected while filling, which have copied the page format of the document when they started, before the report level property expressions were evaluated.
    • setIgnorePagination

      public void setIgnorePagination(Map<String,Object> parameterValues)
    • 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()
    • isPageBreakInhibited

      public abstract boolean isPageBreakInhibited()
    • getFillContext

      public JRFillContext getFillContext()
      Specified by:
      getFillContext in interface ReportFiller
    • 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 name
      calculation - 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 expression
      evaluation - the evaluation type
      Returns:
      the evaluation result
      Throws:
      JRException
    • setFormatFactory

      protected final void setFormatFactory(Map<String,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 JRException
      Cancels the fill process.
      Specified by:
      cancelFill in interface ReportFiller
      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()