ar.com.fdvs.dj.domain.builders
Class SubReportBuilder

java.lang.Object
  extended by ar.com.fdvs.dj.domain.builders.SubReportBuilder

public class SubReportBuilder
extends java.lang.Object


Constructor Summary
SubReportBuilder()
           
 
Method Summary
 SubReportBuilder addParameter(SubreportParameter sp)
           
 SubReportBuilder addParameterFieldType(java.lang.String propertyName, java.lang.String paramName)
           
 Subreport build()
           
 SubReportBuilder setDataSource(int origin, int type, java.lang.String expression)
          Indicates from where to get the data source.
 SubReportBuilder setDataSource(int origin, java.lang.String expression)
          like addDataSource(int origin, int type, String expression) but the type will be of the JRDataSource
 SubReportBuilder setDataSource(java.lang.String expression)
          like addDataSource(int origin, String expression) but the origin will be from a Parameter
 SubReportBuilder setDynamicReport(DynamicReport dynamicReport, LayoutManager layoutManager)
           
 SubReportBuilder setFitToParentPrintableArea(boolean fitparent)
          When true, and id the subreport is dynamic, it's page size and margins will match with the parent report
 SubReportBuilder setParameterMapPath(java.lang.String path)
          defines the KEY in the parent report parameters map where to get the subreport parameters map.
 SubReportBuilder setParameterMapPath(java.lang.String path, int origin)
           
 SubReportBuilder setPathToReport(java.lang.String path)
           
 SubReportBuilder setReport(net.sf.jasperreports.engine.JasperReport jasperReport)
           
 SubReportBuilder setSplitAllowed(boolean splitAllowed)
          If false, and the report doesn't fit in the space given until end of page, it will be pushed to the next page.
 SubReportBuilder setStartInNewPage(boolean startInNewPage)
           
 SubReportBuilder setUserParentReportParameterMap(boolean useParent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubReportBuilder

public SubReportBuilder()
Method Detail

build

public Subreport build()
                throws DJBuilderException
Throws:
DJBuilderException

setDataSource

public SubReportBuilder setDataSource(int origin,
                                      int type,
                                      java.lang.String expression)
Indicates from where to get the data source.

Parameters:
origin - Must be one of these constans located in DJConstants inteface
- SUBREPORT_DATAS_OURCE_ORIGIN_PARAMETER
- SUBREPORT_DATAS_OURCE_ORIGIN_FIELD
- SUBREPORT_DATAS_OURCE_ORIGIN_INTERNAL
type - tell if the datasource is a Collection, an Array, a ResultSet or whatever.
Its value must be a constant from DJConstants of the like DATA_SOURCE_TYPE_...
expression - is -depending on the origin- te path to the datasource
ie: if origin is SUBREPORT_DATAS_OURCE_ORIGIN_PARAMETER, then expression can be "subreport_datasource".
You must in the parameters map an object using "subreport_datasource" as the key.
The object must be an instance of JRDataSource or any of the following
Collection, Array, ResultSet, or any of the data source types provided by Jasper Reports
Returns:

setDataSource

public SubReportBuilder setDataSource(int origin,
                                      java.lang.String expression)
like addDataSource(int origin, int type, String expression) but the type will be of the JRDataSource

Parameters:
origin -
expression -
Returns:

setDataSource

public SubReportBuilder setDataSource(java.lang.String expression)
like addDataSource(int origin, String expression) but the origin will be from a Parameter

Parameters:
origin -
expression -
Returns:

setReport

public SubReportBuilder setReport(net.sf.jasperreports.engine.JasperReport jasperReport)

setDynamicReport

public SubReportBuilder setDynamicReport(DynamicReport dynamicReport,
                                         LayoutManager layoutManager)

setPathToReport

public SubReportBuilder setPathToReport(java.lang.String path)

setStartInNewPage

public SubReportBuilder setStartInNewPage(boolean startInNewPage)

addParameter

public SubReportBuilder addParameter(SubreportParameter sp)

addParameterFieldType

public SubReportBuilder addParameterFieldType(java.lang.String propertyName,
                                              java.lang.String paramName)

setFitToParentPrintableArea

public SubReportBuilder setFitToParentPrintableArea(boolean fitparent)
When true, and id the subreport is dynamic, it's page size and margins will match with the parent report

Parameters:
fitparent -
Returns:

setSplitAllowed

public SubReportBuilder setSplitAllowed(boolean splitAllowed)
If false, and the report doesn't fit in the space given until end of page, it will be pushed to the next page. default is TRUE

Parameters:
splitAllowed -
Returns:

setParameterMapPath

public SubReportBuilder setParameterMapPath(java.lang.String path)
defines the KEY in the parent report parameters map where to get the subreport parameters map.

Parameters:
path - where to get the parameter map for the subrerpot.
Returns:

setParameterMapPath

public SubReportBuilder setParameterMapPath(java.lang.String path,
                                            int origin)
Parameters:
path - where to get the parameter map for the subrerpot
origin - where the paramters map comes from: DJConstants.SUBREPORT_PARAMETER_MAP_ORIGIN_PARAMETER or DJConstants.SUBREPORT_PARAMETER_MAP_ORIGIN_FIELD
Returns:

setUserParentReportParameterMap

public SubReportBuilder setUserParentReportParameterMap(boolean useParent)


Copyright © 2006-2011 FDV Solutions. All Rights Reserved.