Ontimize 5.2072EN

com.ontimize.report.engine.dynamicjasper
Class DynamicJasperEngine

java.lang.Object
  extended bycom.ontimize.report.engine.dynamicjasper.DynamicJasperEngine
All Implemented Interfaces:
IGroupByDate, ReportEngine

public class DynamicJasperEngine
extends java.lang.Object
implements ReportEngine, IGroupByDate

This class is a default implementation of ReportEngine to allow using JasperReports in Table reports. It is used DynamicJasper library (version 3.0.13 - LGPL license) : http://dynamicjasper.sourceforge.net/ to build reports dynamically at runtime. Required libraries: checkLibraries()

Since:
5.2057EN-0.9
Author:
Imatia Innovation SL

Field Summary
static java.lang.String APRIL
           
static java.lang.String AUGUST
           
protected  boolean bPreviousEvaluation
           
protected static boolean checkJasperLibreries
           
static int columnWidth
           
static java.lang.String dateNameSeparator
           
static java.lang.String DEBUG
           
static java.lang.String DECEMBER
           
static int DEFAULT_COLUMN_WIDTH
           
static java.lang.String DEFAULT_JRXML_TEMPLATE_LANDSCAPE
           
static java.lang.String DEFAULT_JRXML_TEMPLATE_LANDSCAPE_NO_LOGO
           
static java.lang.String DEFAULT_JRXML_TEMPLATE_PORTRAIT
           
static java.lang.String DEFAULT_JRXML_TEMPLATE_PORTRAIT_NO_LOGO
           
static int DEFAULT_PADDING_FOR_GROUPS
           
static int DEFAULT_WIDTH_ROW_NUMBERS
           
protected  Style defaultColumnDataStyle
           
protected  Style defaultHeaderForGroupStyle
           
protected  Style defaultHeaderForMultiGroupStyle
           
protected  Style defaultHeaderStyle
           
protected  Style defaultSubtitleStyle
           
protected  Style defaultTitleStyle
           
static int defaultVirtualizerCacheSize
           
protected  DynamicReport dr
           
protected  CustomDynamicReportBuilder drb
          Builder for reports, with this instance is built the report.
 java.lang.String dynamicGroupIdentifier
           
protected  EntityResult erData
           
protected  TableModelDataSource erDataSource
          Objects that implements Jasper interface JRDataSource to store report data.
static java.lang.String ERROR
           
static java.lang.String FATAL
           
static java.lang.String FEBRUARY
           
static java.lang.String FIRST_QUARTER
           
static java.lang.String FOURTH_QUARTER
           
protected  GroupBuilder gb1
          Group builder
static java.lang.String GROUP_BY_DEFAULT
           
static java.lang.String GROUP_COUNT_LABEL
           
static java.lang.String groupCloseCharacter
           
static java.lang.String groupDateSeparator
           
static java.lang.String groupOpenCharacter
           
protected  java.util.Hashtable hColsPositions
           
protected  java.util.Hashtable hMultiGroupColumns
           
protected  java.util.Hashtable hRenderColumns
           
protected  java.util.Hashtable hVirtualColumns
          It contains the equivalences between column and its virtualcolumn.
static java.lang.String INFO
           
protected  boolean isfocusAdapterAdded
           
protected  boolean isRegisteredVirtualizer
           
protected  boolean isShowedDateInReportFooter
           
static boolean isShowedDateInReportFooterByDefault
           
protected  boolean isShowedPageInReportFooter
           
static boolean isShowedPageInReportFooterByDefault
           
protected  boolean isShowedSubtitle
           
static boolean isShowedSubtitleByDefault
           
protected  boolean isShowedTitle
           
static boolean isShowedTitleByDefault
           
protected  boolean isUsedVirtualizer
           
static java.lang.String JANUARY
           
protected static boolean jasperLibreries
           
protected  JasperPrint jp
           
static java.lang.String JULY
           
static java.lang.String JUNE
           
static java.lang.String logLevel
           
static java.lang.String MARCH
           
static java.lang.String MAY
           
protected  javax.swing.table.TableModel model
           
static java.lang.String NOVEMBER
           
static java.lang.String numericPattern
          Deprecated. in 5.2060EN-0.1. In next versions numeric patterns for reports are retrieved from table renderers automatically. This variable is ignored.
static java.lang.String OCTOBER
           
protected  Style oddRowBackgroundStyle
           
static int paddingForGroups
           
protected  java.util.Hashtable parameters
           
protected  DefaultReportDialog reportDialog
          Instance for report dialog (this report dialog contains all elements in panel that is showed when user presses the report button in Table).
static java.lang.String reportLogoOnlyForFirstPage
           
static java.lang.String reportLogoPath
           
protected  EntityResult resultmodel
           
static java.lang.String SECOND_QUARTER
           
static java.lang.String SEPTEMBER
           
protected  java.lang.String sHeaderGroupingDate
           
protected  TableSorter sortermodel
           
protected  Style styleFooterVariable
           
protected  Style styleGroupFooterNumberOcurrencesVariable
           
protected  Style styleGroupFooterVariable
           
static java.lang.String THIRD_QUARTER
           
static java.lang.String TRACE
           
static boolean useTemplatesWithDefaultLogo
           
static boolean useVirtualizerByDefault
           
protected  CustomJasperViewer viewer
           
static java.lang.String VIRTUAL_ORDERING_SUFFIX
           
static java.lang.String VIRTUAL_SUFFIX
          Suffix added to virtual column at the end.
protected  JRVirtualizer virtualizer
           
 java.util.List vMultiGroupColumns
           
static java.lang.String WARN
           
static int widthRowNumbers
           
 
Constructor Summary
DynamicJasperEngine()
           
 
Method Summary
 void applyFunctionForColumn(AbstractColumn column, GroupBuilder group)
          Apply function for a specific column.
 void buildColumns()
          It is the method called to build columns in report
protected  GroupBuilder buildGroup(int groupIndex, java.lang.String groupColumn, java.lang.Class groupClass)
          Internal method used to create a group.
 void buildGroups()
          Build groups from selected group columns.
protected  GroupBuilder buildMultiGroup(int groupIndex, java.util.Vector groupColumns, java.util.Vector groupClasses, boolean multiGroupContainsSubgroups)
          Internal method used to create a multi group.
 void buildOptions()
          Creates the JPopUpMenu for options: include row number, show column names,...
 void buildReportDetail()
          Build the report detail: columns and groups.
 void buildReportFooter()
          Builds the report footer.
 void buildReportHeader()
          Builds the report header.
static boolean checkJasperLibraries()
           
 boolean checkLibraries()
          Requires: Dynamic jasper 3.09 Jasperreports 3.5.1 commons-beanutils commons-collections commons-logging iText2.0 (only for PDF export)
 void clearReportVariables()
          Method called before report is built.
 void clearVirtualColumns()
          Clear table model and virtual columns Hashtable..
 void close()
          Invalidates the viewer.
 AbstractColumn configureColumn(AbstractColumn column, java.lang.String columnName, java.lang.Class columnClass)
          Set properties for column: Print Blanks when null values Name of column Title of column Default width for column (It is calculated dynamically)
 ColumnBuilder configureColumnBuilder(ColumnBuilder cb, java.lang.String columnName, java.lang.Class columnClass)
          Sets the property for column builder.
protected  void configureColumnRenders()
           
 GroupBuilder configureGroupBuilder(GroupBuilder gb1, AbstractColumn column)
          Configures group builder for single groups
 AbstractColumn configureGroupColumn(AbstractColumn column, java.lang.String groupColumn, java.lang.Class groupClass, int groupIndex)
          Set properties for column in single group:
NOTE: Implementation is equals to configureMultiGroupColumn but it is duplicated for make easier future inheritance and modularity.
 ColumnBuilder configureGroupColumnBuilder(ColumnBuilder cb, java.lang.String groupColumn, java.lang.Class groupClass)
          Set properties for column builder in simple group: Set column builder property Title of column builder Style for column builder Default width for column (It is calculated dynamically)
 void configureGroupFooterVariables(GroupBuilder gb1, AbstractColumn column)
          Configures and applies variables in group footer.
 void configureGroupNumberOfOcurrencesLabel(GroupBuilder gb1, java.lang.String groupColumn)
          Creates and sets the label to group indicating the number of ocurrences.
 GroupBuilder configureMultiGroupBuilder(GroupBuilder gb1, AbstractColumn column, boolean multiGroupContainsSubgroups)
          Configures group builder for multiple groups
 AbstractColumn configureMultiGroupColumn(AbstractColumn column, java.lang.String groupColumn, java.lang.Class groupClass, int groupIndex)
          Set properties for column in multiple group:
NOTE: Implementation is equals to configureGroupColumn but it is duplicated for make easier future inheritance and modularity.
 ColumnBuilder configureMultiGroupColumnBuilder(ColumnBuilder cb, java.lang.String groupColumn, java.lang.Class groupClass, java.util.Vector groupColumns)
          Set properties for column builder in multiple group: Set column builder property Title of column builder Expression to group by Style for column builder Default width for column (It is calculated dynamically)
protected  java.util.Vector configureMultiGroupColumnClasses(java.util.Vector groupClasses)
          Iterates in group classes and modify java.sql.Date columns by java.util.Date columns
 void configureTemplate()
          Fixes in report the selected template.
 CustomDynamicReportBuilder configureVirtualColumn(CustomDynamicReportBuilder drb, java.lang.String columnName, java.lang.Class columnClass)
          Create and register a hidden virtual column for dates.
 java.lang.String createDatePattern(DateCellRenderer rendererColumn)
           
 java.lang.String createDecimalPattern(RealCellRenderer rendererColumn)
           
 void createModel()
          Creates the model.
 void createReportBuilder()
          Creates the report builder.
 void createRowNumberColumn()
          Creates and adds a column to show the number of rows in report.
static javax.swing.table.TableModel createTableModel(java.util.Hashtable res, boolean returnEmptyStrings, boolean convertBB2Im, boolean convertBooleanToIm)
          Creates a table model that replaces complete null columns by empty strings.
 void createViewer(JasperPrint jp, DefaultReportDialog reportDialog)
          Creates the jasper viewer to show in report dialog.
 void createVirtualColumns()
           
 void dispose()
          Sets the dynamic report builder to null.
 boolean existFunctionForColumn(AbstractColumn column)
          This method checks is a specified column is numeric.
 boolean existFunctions()
          Checks whether any column in function list is selected.
 boolean existGroups()
          Checks whether any column in group list is selected.
 boolean existVirtualColumns()
          Checks whether exist virtual columns.
 BasicReportStoreDefinition generaReportStoreDefinition(java.lang.String pageTitle)
          Not implemented.
protected  void generateOtherMultiGroupColumns(java.util.Vector groupColumns, java.util.Vector groupClasses)
          Parameter groupColumns contains all columns to create the multigroup.
 java.lang.Object generateReport(java.lang.String pageTitle, java.lang.String description)
          This method builds report.
 java.util.Vector generateVirtualColumnValues(java.lang.String column, java.util.Vector originalColumnValues)
           
 java.lang.Object getBaseTemplate()
          Returns the viewer.
 java.lang.Class getColumnClassForColumn(java.lang.String columnName)
          This method iterates in model and returns th class of column passed in parameter.
 java.lang.String getColumnFromVirtualColumn(java.lang.String virtualColumn)
          Gets identifier for column from virtual column.
 int getColumnIndex(java.lang.String columnName, javax.swing.table.TableModel model)
          Get column index associated with columnName in a particular table model.
protected  java.lang.String getColumnPatternFromRenderer(javax.swing.table.TableCellRenderer rendererColumn)
           
protected  javax.swing.table.TableModel getDataModel(boolean ascending)
          Gets the model with data for report.
 javax.swing.table.TableModel getDataModelWithVirtualColumns()
           
 java.lang.String getDatePattern()
          Returns a date pattern locale-dependent.
 java.util.List getDefaultTemplates()
          Returns the default templates.
 DynamicReport getDynamicReport()
           
 java.lang.String getEvaluationValueForGroupingDate(java.util.Map fields, java.lang.String groupColumn)
          This method performs operation to return a string with values for grouping dates.
 CustomExpression getExpressionForRowNumbers()
          This method gets values to add the row number in report.
 java.lang.String getGroupedKey(java.lang.String groupColumn)
          Gets the text showed in grouping dates.
 java.lang.String getGroupIdentifier(java.lang.String groupColumn)
          Gets the group identifier.
 java.lang.String getGroupingDatePattern()
           
 java.lang.String getGroupingDateTimePattern()
           
 GroupLayout getGroupLayoutForColumn(AbstractColumn column)
          Obtains the layout for a determined group.
 GroupLayout getGroupLayoutForMultiGroup(AbstractColumn column, boolean multiGroupContainsSubgroups)
          Get group layout for multigroup.
protected  LayoutManager getLayoutManager()
          Gets the manager that controls the layout of report.
 java.lang.String getMonthText(int month)
           
 java.util.List getMultiGroupColumns()
           
 java.util.Vector getMultiGroupColumnsForColumn(java.lang.String initialMultiColumn)
          Gets the vector with columns in multigroup from the initial column of multigroup
protected  java.lang.Object getMultigroupExpression(java.util.List groupColumns, java.util.Map fields, java.util.Map variables, java.util.Map parameters)
          This method performs operation to return a string with values for grouping with multiple columns.
 DJCalculation getOperation(java.lang.Integer operation)
          Gets the operation to use in variables of footer (SUM, MAX, MIN, AVG).
 TableSorter getOrderedDataModel(boolean ascending)
          This method is used to order a table model.
 java.lang.String getPageTitle()
          Gets the text of title field.
 java.util.Hashtable getParameters()
          Returns the parameters that are passed to report.
 java.lang.String getPatternForColumn(java.lang.String columnName)
           
 PreviewDialog getPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base)
          Implementation of this method for each engine must return a dialog with printed report.
 PreviewDialog getPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base, ReportProcessor r)
          Implementation of this method for each engine must return a dialog with printed report.
 PreviewDialog getPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base, java.lang.String[] order, boolean[] asc)
          Implementation of this method for each engine must return a dialog with printed report.
 PreviewDialog getPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base, java.lang.String[] order, boolean[] asc, ReportProcessor r)
          Implementation of this method for each engine must return a dialog with printed report.
 PreviewDialog getPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base, java.lang.String[] order, boolean[] asc, ReportProcessor r, java.awt.print.PageFormat pf)
          Implementation of this method for each engine must return a dialog with printed report.
 java.lang.String getQuarterText(int quarter)
           
 int getRealNumberOfGroups()
          Returns the number of groups that user is viewing printed in report (This number matches with number of items selected in group column list when all group columns are also selected in printing column list).
 java.lang.String getReportDescription()
          Gets the text of subtitle field.
 java.lang.String getReportEngineName()
          Returns the name of report Engine: "DynamicJasper".
 java.lang.String getTextOperation(java.lang.Integer operation)
          Gets the text for operation applied in column
 java.lang.String getTitle()
          Convenience method.
 java.lang.String getVirtualColumn(java.lang.String currentGroupItem)
          Returns the identifier for virtual column addign to currentGroupItem the suffix indicated by variable: VIRTUAL_SUFFIX
 java.lang.String getVirtualColumnForOrdering(java.lang.String virtualColumn)
          Returns the identifier for virtual column used for ordering to virtualColumn the suffix indicated by variable: IRTUAL_ORDERING_SUFFIX
 java.util.Hashtable getVirtualColumns()
           
 boolean isBaseColumnFromVirtualColumn(java.lang.String column)
          Checks whether a column is the original column for a virtual column.
 boolean isColumnGroupInSimpleGroup(java.lang.String groupColumn)
           
 boolean isDateColumn(java.lang.Class dateClass)
          Checks whether column class is a Date. .
 boolean isGroupColumnPrinted(int column)
          For a group column checks whether this column is being viewed (selected in printing column list).
 boolean isImageColumn(java.lang.Class imageClass)
          Checks whether column class is sun.awt.image.ToolkitImage.
 boolean isMoreInternalGroup(int groupindex)
          Checks whether the group indicated by groupindex is the most internal in layout.
 boolean isNumericClass(java.lang.Object classparameter)
          Returns true when parameter satisfies Number.class.isAssignableFrom() condition.
 boolean isSelectedMultiGrouping()
          Checks whether contextual menu in group list is marked to show a multi-group report (header with selected columns).
 boolean isSelectedNumberOfOccurrences()
          Checks whether number of occurrences in function panel is selected.
 boolean isSelectedPrintColumnNames()
          Checks whether column names are printed.
 boolean isSelectedUpdateDynamically()
          Checks whether UpdateDynamically toggle button is pressed.
 boolean isShowedDateInReportFooter()
          Checks whether date in report is showed.
 boolean isShowedGroupDetails()
          Determines if check for hiding group details is marked in report menu options.
 boolean isShowedPageInReportFooter()
          Checks whether page in report footer is showed.
 boolean isShowedRowNumber()
          Checks whether row number column item in pop-up menu for options is selected.
 boolean isShowedSubtitle()
          Checks whether page in report footer is showed.
 boolean isShowedTitle()
          Checks whether page in report footer is showed.
 boolean isUsedVirtualizer()
          Returns true when a virtualizer is used.
 boolean isVirtualColumn(java.lang.String column)
          Checks whether the column parameter is a virtual column.
 void keepOriginalColumnPositions(int i)
          Stores in Hashtable hColsPositions the original order in columns.
 void refreshOntimizeViewer()
          Refreshes the viewer.
 void refreshOntimizeViewer(JasperPrint jp)
          Refreshes the viewer for a specific jasper print passed in parameter.
 CustomDynamicReportBuilder registerField(java.lang.String columnName, java.lang.Class columnClass)
          Register a field in report.
 void setColumnDataStyle()
          Sets the style for report layout: font, padding, alignment.
 ColumnBuilder setColumnGroupClass(ColumnBuilder cb, java.lang.String groupColumn, java.lang.Class groupClass)
          Sets the group column class for column group.
 void setColumnHeaderForGroupsStyle()
          Sets the sytle for elements that are showed in groups header.
 void setColumnHeaderForMultiGroupsStyle()
          Sets the sytle for elements that are showed in groups header.
 void setColumnHeaderStyle()
          Sets the style for columns showed in header of report.
 ColumnBuilder setDateGroupingExpression(ColumnBuilder cb, java.lang.String groupColumn)
          Fixes the property column class to String and date grouping expression to column builder.
 void setDefaultParameters()
          Sets the parameters that are passed by default to the report: JRParameter.REPORT_VIRTUALIZER: This parameter allows to use virtualizers to manage big reports.
 void setDefaultReportDialog(java.lang.Object reportDialog)
          Report dialog is passed to engine to get references to dialog elements from engine (i.e. check buttons marked, columns selected,...).
 void setDynamicReport(DynamicReport dr)
           
 void setFooterVariableStyle()
          Sets the style for footer variables.
 void setGroupFooterNumberOcurrencesVariableStyle()
          Sets style for variables in group footer.
 void setGroupFooterVariableStyle()
          Sets style for variables in group footer.
 void setIsUsedVirtualizer(boolean isUsedVirtualizer)
          Allows to modify the variable that manages the use of virtualizers.
static void setLogLevel(java.lang.String logLevel)
          Sets log level for this engine.
 void setParameters(java.util.Hashtable parameters)
          Adds the specified parameters to report.
 AbstractColumn setPatterns(AbstractColumn column, java.lang.Class columnClass)
           
 void setReportDescription(java.lang.String text)
          Sets the title of report.
 void setReportLogo()
          Sets the report logo for template when it is not used the default template.
 void setReportStyles()
          Sets the template file in report and sets all styles.
 void setRowReportSyles()
          Sets the background color for odd and even rows.
 void setShowedDateInReportFooter(boolean isShowedDateInReportFooter)
          Allows to modify the variable that shows date in report footer.
 void setShowedPageInReportFooter(boolean isShowedPageInReportFooter)
          Allows to modify the variable that shows page in report footer.
 void setTitleandSubtitleStyle()
          Sets the styles for title and subtitle.
 void setTitleReport(java.lang.String text)
          Sets the title of report.
 PreviewDialog showPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.lang.String template, java.net.URL base)
          Implementation of this method for each engine must show a dialog with printed report.
 PreviewDialog showPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.lang.String template, java.net.URL base, ReportProcessor rp)
          Implementation of this method for each engine must show a dialog with printed report.
 PreviewDialog showPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base)
          Implementation of this method for each engine must show a dialog with printed report.
 PreviewDialog showPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base, ReportProcessor rp)
          Implementation of this method for each engine must show a dialog with printed report.
 PreviewDialog showPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base, java.lang.String[] order, boolean[] asc)
          Implementation of this method for each engine must show a dialog with printed report.
 PreviewDialog showPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base, java.lang.String[] order, boolean[] asc, ReportProcessor rp)
          Implementation of this method for each engine must show a dialog with printed report.
 PreviewDialog showPreviewDialog(java.awt.Component c, java.lang.String title, javax.swing.table.TableModel m, java.net.URL template, java.net.URL base, java.lang.String[] order, boolean[] asc, ReportProcessor rp, java.awt.print.PageFormat pf)
          Implementation of this method for each engine must show a dialog with printed report.
 void updateReport(boolean force)
          Generates the report again.
 void viewJasperDialog(java.awt.Component parent, java.lang.String template, java.lang.String title)
          Fills and views jasper report from a compiled report template without jasper parameters.
 void viewJasperDialog(java.awt.Component parent, java.net.URL template)
          Fills and view report from template that contains compiled report without parameters.
 void viewJasperDialog(java.awt.Component parent, java.net.URL template, javax.swing.table.TableModel dataModel, java.lang.String title, java.util.Hashtable reportParameters)
          Views jasper dialog from a URL where is the template.
 void viewJasperDialog(java.lang.String template)
          Views jasper dialog from a .jrxml template.
 void viewJasperDialog(java.lang.String template, java.lang.String title)
          Fills and views jasper report from a compiled report template without jasper parameters.
 void viewJasperDialog(java.net.URL template)
          Fills and view report from template that contains compiled report without parameters.
 void viewJasperDialog(java.net.URL template, java.util.Hashtable data, java.util.Hashtable reportParameters)
          Views jasper dialog from a URL where is the template.
 void viewJasperDialog(java.net.URL template, javax.swing.table.TableModel dataModel, java.util.Hashtable reportParameters)
          Views jasper dialog from a URL where is the template.
 void viewJasperDialog(java.net.URL template, javax.swing.table.TableModel dataModel, java.lang.String title, java.util.Hashtable reportParameters)
          Views jasper dialog from a URL where is the template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE

public static final java.lang.String TRACE
See Also:
Constant Field Values

DEBUG

public static final java.lang.String DEBUG
See Also:
Constant Field Values

INFO

public static final java.lang.String INFO
See Also:
Constant Field Values

WARN

public static final java.lang.String WARN
See Also:
Constant Field Values

ERROR

public static final java.lang.String ERROR
See Also:
Constant Field Values

FATAL

public static final java.lang.String FATAL
See Also:
Constant Field Values

logLevel

public static java.lang.String logLevel

GROUP_COUNT_LABEL

public static final java.lang.String GROUP_COUNT_LABEL
See Also:
Constant Field Values

erDataSource

protected TableModelDataSource erDataSource
Objects that implements Jasper interface JRDataSource to store report data.


DEFAULT_PADDING_FOR_GROUPS

public static final int DEFAULT_PADDING_FOR_GROUPS
See Also:
Constant Field Values

DEFAULT_WIDTH_ROW_NUMBERS

public static final int DEFAULT_WIDTH_ROW_NUMBERS
See Also:
Constant Field Values

DEFAULT_COLUMN_WIDTH

public static final int DEFAULT_COLUMN_WIDTH
See Also:
Constant Field Values

paddingForGroups

public static int paddingForGroups

widthRowNumbers

public static int widthRowNumbers

columnWidth

public static int columnWidth

useTemplatesWithDefaultLogo

public static boolean useTemplatesWithDefaultLogo

reportLogoPath

public static java.lang.String reportLogoPath

reportLogoOnlyForFirstPage

public static java.lang.String reportLogoOnlyForFirstPage

dynamicGroupIdentifier

public java.lang.String dynamicGroupIdentifier

DEFAULT_JRXML_TEMPLATE_PORTRAIT

public static final java.lang.String DEFAULT_JRXML_TEMPLATE_PORTRAIT
See Also:
Constant Field Values

DEFAULT_JRXML_TEMPLATE_LANDSCAPE

public static final java.lang.String DEFAULT_JRXML_TEMPLATE_LANDSCAPE
See Also:
Constant Field Values

DEFAULT_JRXML_TEMPLATE_PORTRAIT_NO_LOGO

public static final java.lang.String DEFAULT_JRXML_TEMPLATE_PORTRAIT_NO_LOGO
See Also:
Constant Field Values

DEFAULT_JRXML_TEMPLATE_LANDSCAPE_NO_LOGO

public static final java.lang.String DEFAULT_JRXML_TEMPLATE_LANDSCAPE_NO_LOGO
See Also:
Constant Field Values

JANUARY

public static final java.lang.String JANUARY
See Also:
Constant Field Values

FEBRUARY

public static final java.lang.String FEBRUARY
See Also:
Constant Field Values

MARCH

public static final java.lang.String MARCH
See Also:
Constant Field Values

APRIL

public static final java.lang.String APRIL
See Also:
Constant Field Values

MAY

public static final java.lang.String MAY
See Also:
Constant Field Values

JUNE

public static final java.lang.String JUNE
See Also:
Constant Field Values

JULY

public static final java.lang.String JULY
See Also:
Constant Field Values

AUGUST

public static final java.lang.String AUGUST
See Also:
Constant Field Values

SEPTEMBER

public static final java.lang.String SEPTEMBER
See Also:
Constant Field Values

OCTOBER

public static final java.lang.String OCTOBER
See Also:
Constant Field Values

NOVEMBER

public static final java.lang.String NOVEMBER
See Also:
Constant Field Values

DECEMBER

public static final java.lang.String DECEMBER
See Also:
Constant Field Values

FIRST_QUARTER

public static final java.lang.String FIRST_QUARTER
See Also:
Constant Field Values

SECOND_QUARTER

public static final java.lang.String SECOND_QUARTER
See Also:
Constant Field Values

THIRD_QUARTER

public static final java.lang.String THIRD_QUARTER
See Also:
Constant Field Values

FOURTH_QUARTER

public static final java.lang.String FOURTH_QUARTER
See Also:
Constant Field Values

dateNameSeparator

public static java.lang.String dateNameSeparator

groupDateSeparator

public static java.lang.String groupDateSeparator

groupOpenCharacter

public static java.lang.String groupOpenCharacter

groupCloseCharacter

public static java.lang.String groupCloseCharacter

GROUP_BY_DEFAULT

public static java.lang.String GROUP_BY_DEFAULT

VIRTUAL_SUFFIX

public static java.lang.String VIRTUAL_SUFFIX
Suffix added to virtual column at the end. By default, _virtual_column


VIRTUAL_ORDERING_SUFFIX

public static java.lang.String VIRTUAL_ORDERING_SUFFIX

reportDialog

protected DefaultReportDialog reportDialog
Instance for report dialog (this report dialog contains all elements in panel that is showed when user presses the report button in Table).


drb

protected CustomDynamicReportBuilder drb
Builder for reports, with this instance is built the report.


dr

protected DynamicReport dr

model

protected javax.swing.table.TableModel model

sortermodel

protected TableSorter sortermodel

erData

protected EntityResult erData

isfocusAdapterAdded

protected boolean isfocusAdapterAdded

bPreviousEvaluation

protected boolean bPreviousEvaluation

sHeaderGroupingDate

protected java.lang.String sHeaderGroupingDate

resultmodel

protected EntityResult resultmodel

parameters

protected java.util.Hashtable parameters

hColsPositions

protected java.util.Hashtable hColsPositions

hMultiGroupColumns

protected java.util.Hashtable hMultiGroupColumns

hRenderColumns

protected java.util.Hashtable hRenderColumns

viewer

protected CustomJasperViewer viewer

jp

protected JasperPrint jp

gb1

protected GroupBuilder gb1
Group builder


vMultiGroupColumns

public java.util.List vMultiGroupColumns

hVirtualColumns

protected java.util.Hashtable hVirtualColumns
It contains the equivalences between column and its virtualcolumn. For example, when user selects an item for grouping by a date column, automatically it is added a virtual column to model (with name original_column + VIRTUAL_SUFFIX required for calculations. In this case, in this Hashtable is added an entry (original_column , original_column + VIRTUAL_SUFFIX).


defaultTitleStyle

protected Style defaultTitleStyle

defaultSubtitleStyle

protected Style defaultSubtitleStyle

defaultHeaderStyle

protected Style defaultHeaderStyle

defaultHeaderForGroupStyle

protected Style defaultHeaderForGroupStyle

defaultHeaderForMultiGroupStyle

protected Style defaultHeaderForMultiGroupStyle

defaultColumnDataStyle

protected Style defaultColumnDataStyle

oddRowBackgroundStyle

protected Style oddRowBackgroundStyle

styleFooterVariable

protected Style styleFooterVariable

styleGroupFooterVariable

protected Style styleGroupFooterVariable

styleGroupFooterNumberOcurrencesVariable

protected Style styleGroupFooterNumberOcurrencesVariable

virtualizer

protected JRVirtualizer virtualizer

useVirtualizerByDefault

public static boolean useVirtualizerByDefault

isShowedDateInReportFooterByDefault

public static boolean isShowedDateInReportFooterByDefault

isShowedPageInReportFooterByDefault

public static boolean isShowedPageInReportFooterByDefault

isShowedTitleByDefault

public static boolean isShowedTitleByDefault

isShowedSubtitleByDefault

public static boolean isShowedSubtitleByDefault

defaultVirtualizerCacheSize

public static int defaultVirtualizerCacheSize

isUsedVirtualizer

protected boolean isUsedVirtualizer

isRegisteredVirtualizer

protected boolean isRegisteredVirtualizer

isShowedDateInReportFooter

protected boolean isShowedDateInReportFooter

isShowedPageInReportFooter

protected boolean isShowedPageInReportFooter

isShowedTitle

protected boolean isShowedTitle

isShowedSubtitle

protected boolean isShowedSubtitle

numericPattern

public static java.lang.String numericPattern
Deprecated. in 5.2060EN-0.1. In next versions numeric patterns for reports are retrieved from table renderers automatically. This variable is ignored.


checkJasperLibreries

protected static boolean checkJasperLibreries

jasperLibreries

protected static boolean jasperLibreries
Constructor Detail

DynamicJasperEngine

public DynamicJasperEngine()
Method Detail

setLogLevel

public static void setLogLevel(java.lang.String logLevel)
Sets log level for this engine. Available values (static variables of this class):

Parameters:
logLevel - the String with error level.

close

public void close()
Description copied from interface: ReportEngine
Invalidates the viewer. Implementation of this method could be not required.

Specified by:
close in interface ReportEngine

dispose

public void dispose()
Sets the dynamic report builder to null.

Specified by:
dispose in interface ReportEngine

generaReportStoreDefinition

public BasicReportStoreDefinition generaReportStoreDefinition(java.lang.String pageTitle)
Not implemented.

Specified by:
generaReportStoreDefinition in interface ReportEngine
Parameters:
pageTitle - the title of page
Returns:
The reportStoreDefinition

getLayoutManager

protected LayoutManager getLayoutManager()
Gets the manager that controls the layout of report.

Returns:
the layout manager

createModel

public void createModel()
Creates the model. This model contains the data to show in report. When report has groups this model is a com.ontimize.report.TableSorter object in other situation is a EntityResultTableModel.

See Also:
{@link DefaultReportDialog#getOrderedDataModel(boolean)}

createVirtualColumns

public void createVirtualColumns()

getDataModelWithVirtualColumns

public javax.swing.table.TableModel getDataModelWithVirtualColumns()

getGroupingDateTimePattern

public java.lang.String getGroupingDateTimePattern()

getGroupingDatePattern

public java.lang.String getGroupingDatePattern()

setPatterns

public AbstractColumn setPatterns(AbstractColumn column,
                                  java.lang.Class columnClass)

generateVirtualColumnValues

public java.util.Vector generateVirtualColumnValues(java.lang.String column,
                                                    java.util.Vector originalColumnValues)

createReportBuilder

public void createReportBuilder()
Creates the report builder.


getDynamicReport

public DynamicReport getDynamicReport()

setDynamicReport

public void setDynamicReport(DynamicReport dr)

generateReport

public java.lang.Object generateReport(java.lang.String pageTitle,
                                       java.lang.String description)
                                throws java.lang.Exception
This method builds report. Calls to: Notice: title and description (subtitle) parameters not used in this implementation.

Specified by:
generateReport in interface ReportEngine
Parameters:
pageTitle - the title of report
description - subtitle of report
Returns:
the generated report
Throws:
java.lang.Exception - A new Exception

clearReportVariables

public void clearReportVariables()
Method called before report is built. It is useful to clear variables and data structures that are shared in report.


setReportLogo

public void setReportLogo()
Sets the report logo for template when it is not used the default template. There are two possible configurations:


getBaseTemplate

public java.lang.Object getBaseTemplate()
Returns the viewer.

Specified by:
getBaseTemplate in interface ReportEngine
Returns:
the viewer

getPageTitle

public java.lang.String getPageTitle()
Gets the text of title field.

Specified by:
getPageTitle in interface ReportEngine
Returns:
the title of page

getReportDescription

public java.lang.String getReportDescription()
Gets the text of subtitle field.

Specified by:
getReportDescription in interface ReportEngine
Returns:
the subtitle text

getColumnIndex

public int getColumnIndex(java.lang.String columnName,
                          javax.swing.table.TableModel model)
Get column index associated with columnName in a particular table model.

Parameters:
columnName - The name of column
model - Data model
Returns:
the index of column or -1 when it is not encountered

getDataModel

protected javax.swing.table.TableModel getDataModel(boolean ascending)
Gets the model with data for report. It can be a TableModel or a TableSorter depending on existing groups (For checking about existence of groups getRealNumberOfGroups()).

Parameters:
ascending - the order for data
Returns:
the data model

getOrderedDataModel

public TableSorter getOrderedDataModel(boolean ascending)
This method is used to order a table model. The table model is ordered when exists groups in reports or when user presses ascending-descending order in report dialog (a-z pop-up menu).

Parameters:
ascending - condition to ascending-descending order.
Returns:
the com.ontimize.report.TableSorter with order

getTitle

public java.lang.String getTitle()
Convenience method.

Specified by:
getTitle in interface ReportEngine
Returns:
the title

setDefaultReportDialog

public void setDefaultReportDialog(java.lang.Object reportDialog)
Description copied from interface: ReportEngine
Report dialog is passed to engine to get references to dialog elements from engine (i.e. check buttons marked, columns selected,...).

Specified by:
setDefaultReportDialog in interface ReportEngine
Parameters:
reportDialog - the report dialog to be used in engine.

setTitleReport

public void setTitleReport(java.lang.String text)
Description copied from interface: ReportEngine
Sets the title of report.

Specified by:
setTitleReport in interface ReportEngine
Parameters:
text - the text to set in title

setReportDescription

public void setReportDescription(java.lang.String text)
Description copied from interface: ReportEngine
Sets the title of report.

Specified by:
setReportDescription in interface ReportEngine
Parameters:
text - the text to set in title

updateReport

public void updateReport(boolean force)
Generates the report again. If

Specified by:
updateReport in interface ReportEngine
Parameters:
force - The boolean to allow/deny dynamically updates when user presses the update dynamically button in report dialog.

setParameters

public void setParameters(java.util.Hashtable parameters)
Adds the specified parameters to report. If one parameter

Parameters:
parameters -

getParameters

public java.util.Hashtable getParameters()
Returns the parameters that are passed to report.

Returns:

getDatePattern

public java.lang.String getDatePattern()
Returns a date pattern locale-dependent.

Returns:
the string with date pattern

setDefaultParameters

public void setDefaultParameters()
Sets the parameters that are passed by default to the report:


isUsedVirtualizer

public boolean isUsedVirtualizer()
Returns true when a virtualizer is used.

Returns:
the condition

setIsUsedVirtualizer

public void setIsUsedVirtualizer(boolean isUsedVirtualizer)
Allows to modify the variable that manages the use of virtualizers.

Parameters:
isUsedVirtualizer - Condition to use virtualizers

isShowedDateInReportFooter

public boolean isShowedDateInReportFooter()
Checks whether date in report is showed.

Returns:
true When data in report is showed

setShowedDateInReportFooter

public void setShowedDateInReportFooter(boolean isShowedDateInReportFooter)
Allows to modify the variable that shows date in report footer.

Parameters:
isShowedDateInReportFooter - the variable to show/hide date in report footer

isShowedPageInReportFooter

public boolean isShowedPageInReportFooter()
Checks whether page in report footer is showed.

Returns:
true When page in report footer is showed

isShowedTitle

public boolean isShowedTitle()
Checks whether page in report footer is showed.

Returns:
true When page in report footer is showed

isShowedSubtitle

public boolean isShowedSubtitle()
Checks whether page in report footer is showed.

Returns:
true When page in report footer is showed

setShowedPageInReportFooter

public void setShowedPageInReportFooter(boolean isShowedPageInReportFooter)
Allows to modify the variable that shows page in report footer.

Parameters:
isShowedPageInReportFooter - The variable to show/hide page in report footer

createViewer

public void createViewer(JasperPrint jp,
                         DefaultReportDialog reportDialog)
Creates the jasper viewer to show in report dialog. Sets the default zoom ratio and adds focus adapters for title and subtitle in toolbar.

Parameters:
jp - the jasperprint object
reportDialog - the dialog where viewer is added

refreshOntimizeViewer

public void refreshOntimizeViewer()
Refreshes the viewer. Rebuilds the report, generates the jasper print and send it to viewer.


refreshOntimizeViewer

public void refreshOntimizeViewer(JasperPrint jp)
Refreshes the viewer for a specific jasper print passed in parameter.


getDefaultTemplates

public java.util.List getDefaultTemplates()
Returns the default templates. If exists property: com.ontimize.report.templates these templates will be used. Otherwise, default templates contain default parameters and default logo. To use a empty template (without logo), user can set to "false" the static variable useTemplatesWithDefaultLogo.

Specified by:
getDefaultTemplates in interface ReportEngine
Returns:
the List with default templates.

setReportStyles

public void setReportStyles()
Sets the template file in report and sets all styles.


setTitleandSubtitleStyle

public void setTitleandSubtitleStyle()
Sets the styles for title and subtitle.


setColumnHeaderStyle

public void setColumnHeaderStyle()
Sets the style for columns showed in header of report.


setColumnDataStyle

public void setColumnDataStyle()
Sets the style for report layout: font, padding, alignment.


setColumnHeaderForGroupsStyle

public void setColumnHeaderForGroupsStyle()
Sets the sytle for elements that are showed in groups header. For example, if we are grouping by column City and in these group city is Barcelona, these styles will be applied to group header, in this case to: City Barcelona


setColumnHeaderForMultiGroupsStyle

public void setColumnHeaderForMultiGroupsStyle()
Sets the sytle for elements that are showed in groups header. For example, if we are grouping by column City and in these group city is Barcelona, these styles will be applied to group header, in this case to: City Barcelona


setFooterVariableStyle

public void setFooterVariableStyle()
Sets the style for footer variables.


setGroupFooterVariableStyle

public void setGroupFooterVariableStyle()
Sets style for variables in group footer.


setGroupFooterNumberOcurrencesVariableStyle

public void setGroupFooterNumberOcurrencesVariableStyle()
Sets style for variables in group footer.


setRowReportSyles

public void setRowReportSyles()
Sets the background color for odd and even rows.


buildReportFooter

public void buildReportFooter()
Builds the report footer. Footer by default is built with parameters (setDefaultParameters() passed to report, so this method is empty in this implementation


buildReportHeader

public void buildReportHeader()
Builds the report header. Sets the report logo when is not used the default and sets title and subtitle.


buildReportDetail

public void buildReportDetail()
                       throws java.lang.Exception
Build the report detail: columns and groups.

Throws:
java.lang.Exception - when an Exception is thrown.

configureColumnRenders

protected void configureColumnRenders()

getPatternForColumn

public java.lang.String getPatternForColumn(java.lang.String columnName)

getColumnPatternFromRenderer

protected java.lang.String getColumnPatternFromRenderer(javax.swing.table.TableCellRenderer rendererColumn)

createDatePattern

public java.lang.String createDatePattern(DateCellRenderer rendererColumn)

createDecimalPattern

public java.lang.String createDecimalPattern(RealCellRenderer rendererColumn)

configureTemplate

public void configureTemplate()
                       throws java.lang.Exception
Fixes in report the selected template.

Throws:
java.lang.Exception - When template is not selected.

getExpressionForRowNumbers

public CustomExpression getExpressionForRowNumbers()
This method gets values to add the row number in report.

Returns:
the expression

buildColumns

public void buildColumns()
                  throws java.lang.Exception
It is the method called to build columns in report

Throws:
java.lang.Exception - when an Exception occurs

configureVirtualColumn

public CustomDynamicReportBuilder configureVirtualColumn(CustomDynamicReportBuilder drb,
                                                         java.lang.String columnName,
                                                         java.lang.Class columnClass)
                                                  throws java.lang.Exception
Create and register a hidden virtual column for dates.

Parameters:
drb -
columnName -
columnClass -
Returns:
Throws:
java.lang.Exception

registerField

public CustomDynamicReportBuilder registerField(java.lang.String columnName,
                                                java.lang.Class columnClass)
Register a field in report.

Parameters:
columnName - The column name referred to field
columnClass - The class of column
Returns:
the dynamic report with field added

configureColumn

public AbstractColumn configureColumn(AbstractColumn column,
                                      java.lang.String columnName,
                                      java.lang.Class columnClass)
Set properties for column:

Parameters:
column - The initial column
columnName - The column name
Returns:
The column with properties fixed

configureColumnBuilder

public ColumnBuilder configureColumnBuilder(ColumnBuilder cb,
                                            java.lang.String columnName,
                                            java.lang.Class columnClass)
Sets the property for column builder. This column builder is converted to a column with method .build():

Parameters:
cb - The original column builder for this column
columnName - The name of column
columnClass - The class of column
Returns:
The column builder modified

keepOriginalColumnPositions

public void keepOriginalColumnPositions(int i)
Stores in Hashtable hColsPositions the original order in columns. This order is required in layout to be printed correctly.

Parameters:
i - Index of column

createRowNumberColumn

public void createRowNumberColumn()
                           throws ColumnBuilderException
Creates and adds a column to show the number of rows in report. This column is showed in report on the left.

Throws:
ColumnBuilderException

existFunctionForColumn

public boolean existFunctionForColumn(AbstractColumn column)
This method checks is a specified column is numeric. It is a heavy method because iterates for all columns in the model.

Parameters:
column - the column to check
Returns:
condition the condition

isNumericClass

public boolean isNumericClass(java.lang.Object classparameter)
Returns true when parameter satisfies Number.class.isAssignableFrom() condition.

Parameters:
classparameter - the class to check
Returns:
condition about Number instance

getColumnClassForColumn

public java.lang.Class getColumnClassForColumn(java.lang.String columnName)
This method iterates in model and returns th class of column passed in parameter.

Parameters:
columnName - The name of column
Returns:
The class of column

isSelectedMultiGrouping

public boolean isSelectedMultiGrouping()
Checks whether contextual menu in group list is marked to show a multi-group report (header with selected columns).

Returns:
the condition of selection

applyFunctionForColumn

public void applyFunctionForColumn(AbstractColumn column,
                                   GroupBuilder group)
                            throws java.lang.Exception
Apply function for a specific column. This method is called twice: inside buildcolumns(column,null) and in buildgroups(column,group). There are two possibilities:
- when function is for a group (group!=null).
- when function is for a column that is not in a group (group==null at the end of report).

Throws:
java.lang.Exception

getEvaluationValueForGroupingDate

public java.lang.String getEvaluationValueForGroupingDate(java.util.Map fields,
                                                          java.lang.String groupColumn)
This method performs operation to return a string with values for grouping dates. These values are returned in string and are used to know when group must break.

Parameters:
fields - All fields in report
groupColumn - The column to be grouped
Returns:
The String with evaluation date
Throws:
java.text.ParseException

getMultigroupExpression

protected java.lang.Object getMultigroupExpression(java.util.List groupColumns,
                                                   java.util.Map fields,
                                                   java.util.Map variables,
                                                   java.util.Map parameters)
This method performs operation to return a string with values for grouping with multiple columns. These values are returned in string and are used to know when multi group must break.

Parameters:
groupColumns - The list of group columns
fields - Fields in report
variables - Variables in report
parameters - Report parameters
Returns:
The multi group expression

buildMultiGroup

protected GroupBuilder buildMultiGroup(int groupIndex,
                                       java.util.Vector groupColumns,
                                       java.util.Vector groupClasses,
                                       boolean multiGroupContainsSubgroups)
                                throws java.lang.Exception
Internal method used to create a multi group.

Parameters:
groupIndex - Index in group criteria in group columns
multiGroupContainsSubgroups - This condition is true when a multigroup is parent of another groups
Returns:
the GroupBuilder with groups
Throws:
java.lang.Exception - A Exception when group cannot be created.

configureMultiGroupColumnClasses

protected java.util.Vector configureMultiGroupColumnClasses(java.util.Vector groupClasses)
Iterates in group classes and modify java.sql.Date columns by java.util.Date columns

Parameters:
groupClasses - The group classes for a multi group
Returns:
The groupClasses modified

generateOtherMultiGroupColumns

protected void generateOtherMultiGroupColumns(java.util.Vector groupColumns,
                                              java.util.Vector groupClasses)
Parameter groupColumns contains all columns to create the multigroup. First element is the root of group and rest of columns must be registered to build the header of group. So, it is stored in Hashtable hMultiGroupColumns with key the first column of multigroup (first in group list) and value other multigroup columns.

Parameters:
groupColumns - Multi group columns
groupClasses - Multi group classes

getMultiGroupColumnsForColumn

public java.util.Vector getMultiGroupColumnsForColumn(java.lang.String initialMultiColumn)
Gets the vector with columns in multigroup from the initial column of multigroup

Parameters:
initialMultiColumn - The column
Returns:
the rest of columns

buildGroup

protected GroupBuilder buildGroup(int groupIndex,
                                  java.lang.String groupColumn,
                                  java.lang.Class groupClass)
                           throws java.lang.Exception
Internal method used to create a group.

Parameters:
groupIndex - Index in group criteria in group columns
groupColumn - Name of criteria to group by
groupClass - Class for group criteria
Returns:
the GroupBuilder with groups
Throws:
java.lang.Exception - A Exception when group cannot be created.

configureGroupNumberOfOcurrencesLabel

public void configureGroupNumberOfOcurrencesLabel(GroupBuilder gb1,
                                                  java.lang.String groupColumn)
Creates and sets the label to group indicating the number of ocurrences.

Parameters:
gb1 - The group builder
groupColumn - The group column

configureGroupFooterVariables

public void configureGroupFooterVariables(GroupBuilder gb1,
                                          AbstractColumn column)
                                   throws java.lang.Exception
Configures and applies variables in group footer.

Parameters:
gb1 - The group builder
column - Column that is the criteria for grouping
Throws:
java.lang.Exception - when occurs an error configuring group builder

configureGroupBuilder

public GroupBuilder configureGroupBuilder(GroupBuilder gb1,
                                          AbstractColumn column)
Configures group builder for single groups

Parameters:
gb1 - The initial group builder
column - Column that is the criteria for grouping

configureMultiGroupBuilder

public GroupBuilder configureMultiGroupBuilder(GroupBuilder gb1,
                                               AbstractColumn column,
                                               boolean multiGroupContainsSubgroups)
Configures group builder for multiple groups

Parameters:
gb1 - The initial group builder
column - Column that is the criteria for grouping
multiGroupContainsSubgroups - Checks whether group contains nested subgroups

configureMultiGroupColumn

public AbstractColumn configureMultiGroupColumn(AbstractColumn column,
                                                java.lang.String groupColumn,
                                                java.lang.Class groupClass,
                                                int groupIndex)
Set properties for column in multiple group:
NOTE: Implementation is equals to configureGroupColumn but it is duplicated for make easier future inheritance and modularity.

Parameters:
column - The column to be configured
groupColumn - The group column
groupClass - The group class for column
groupIndex - The number of group in report (Used for set width and position)
Returns:
The column modified

configureGroupColumn

public AbstractColumn configureGroupColumn(AbstractColumn column,
                                           java.lang.String groupColumn,
                                           java.lang.Class groupClass,
                                           int groupIndex)
Set properties for column in single group:
NOTE: Implementation is equals to configureMultiGroupColumn but it is duplicated for make easier future inheritance and modularity.

Parameters:
column - The column to be configured
groupColumn - The group column
groupClass - The group class for column
groupIndex - The number of group in report (Used for set width and position)
Returns:
The column modified

configureMultiGroupColumnBuilder

public ColumnBuilder configureMultiGroupColumnBuilder(ColumnBuilder cb,
                                                      java.lang.String groupColumn,
                                                      java.lang.Class groupClass,
                                                      java.util.Vector groupColumns)
Set properties for column builder in multiple group:

Parameters:
cb - The initial column builder
groupColumn - The group column
groupClass - The group class
groupColumns - Other group columns that belongs to multiple group
Returns:
The column builder modified

configureGroupColumnBuilder

public ColumnBuilder configureGroupColumnBuilder(ColumnBuilder cb,
                                                 java.lang.String groupColumn,
                                                 java.lang.Class groupClass)
Set properties for column builder in simple group:

Parameters:
cb - The initial column builder
groupColumn - The group column
groupClass - The group class
Returns:
The column builder modified

getGroupIdentifier

public java.lang.String getGroupIdentifier(java.lang.String groupColumn)
Gets the group identifier. This identifier must be unique.

Parameters:
groupColumn - The name of column
Returns:
The generated identifier

setColumnGroupClass

public ColumnBuilder setColumnGroupClass(ColumnBuilder cb,
                                         java.lang.String groupColumn,
                                         java.lang.Class groupClass)
Sets the group column class for column group. This method changes "java.sql.Date" classes by "java.util.Date".

Parameters:
cb - The column builder
groupColumn - The group column
groupClass - The group class
Returns:
The column builder modified

setDateGroupingExpression

public ColumnBuilder setDateGroupingExpression(ColumnBuilder cb,
                                               java.lang.String groupColumn)
Fixes the property column class to String and date grouping expression to column builder.

Parameters:
cb - The column builder
groupColumn - Column to group
Returns:
The column builder with expression fixed

getGroupedKey

public java.lang.String getGroupedKey(java.lang.String groupColumn)
Gets the text showed in grouping dates.

Parameters:
groupColumn - The name of group column
Returns:
The value of grouped key.

buildGroups

public void buildGroups()
                 throws java.lang.Exception
Build groups from selected group columns.

Throws:
java.lang.Exception - Throws a ColumnBuilderException when occurs an Error building columns for groups.

getVirtualColumn

public java.lang.String getVirtualColumn(java.lang.String currentGroupItem)
Returns the identifier for virtual column addign to currentGroupItem the suffix indicated by variable: VIRTUAL_SUFFIX

Parameters:
currentGroupItem - Name of group column
Returns:
the value

getVirtualColumnForOrdering

public java.lang.String getVirtualColumnForOrdering(java.lang.String virtualColumn)
Returns the identifier for virtual column used for ordering to virtualColumn the suffix indicated by variable: IRTUAL_ORDERING_SUFFIX

Returns:
the value

getColumnFromVirtualColumn

public java.lang.String getColumnFromVirtualColumn(java.lang.String virtualColumn)
Gets identifier for column from virtual column. This identifier is created adding to column the suffix variable: VIRTUAL_SUFFIX.

Parameters:
virtualColumn - The name of virtual column
Returns:
the name of column

isMoreInternalGroup

public boolean isMoreInternalGroup(int groupindex)
Checks whether the group indicated by groupindex is the most internal in layout.

Returns:
The condition about this group

getGroupLayoutForColumn

public GroupLayout getGroupLayoutForColumn(AbstractColumn column)
Obtains the layout for a determined group. It is necessary for embedded groups where only the internal group should show the title of columns (Header).

Group1 criterion1
  Group 2 criterion2
   Header1 Header2 Header 3
   value 1.1   value1.2   value1.3
   value 2.1   value2.2   value2.3

Parameters:
column - the column to compute the layout
Returns:
the layout for group
See Also:
GroupLayout, CustomGroupLayout

getGroupLayoutForMultiGroup

public GroupLayout getGroupLayoutForMultiGroup(AbstractColumn column,
                                               boolean multiGroupContainsSubgroups)
Get group layout for multigroup. Layout must show column names when group does not contains subgroups. On the contrary, only the most internal subgroup should contain the column names.

Parameters:
column - Group column to check the layout
multiGroupContainsSubgroups - Condition about existence of subgroups for a determined group
Returns:
the group layout

isShowedGroupDetails

public boolean isShowedGroupDetails()
Determines if check for hiding group details is marked in report menu options.

Returns:
the condition

existGroups

public boolean existGroups()
Checks whether any column in group list is selected.

Returns:
the condition about group existence

getRealNumberOfGroups

public int getRealNumberOfGroups()
Returns the number of groups that user is viewing printed in report (This number matches with number of items selected in group column list when all group columns are also selected in printing column list).

Returns:
the number of viewed groups

isGroupColumnPrinted

public boolean isGroupColumnPrinted(int column)
For a group column checks whether this column is being viewed (selected in printing column list).

Parameters:
column - the index of column
Returns:
true when it is visible

existFunctions

public boolean existFunctions()
Checks whether any column in function list is selected. It is not considered the item that shows the number of occurrences.

Returns:
the condition about function existence

isShowedRowNumber

public boolean isShowedRowNumber()
Checks whether row number column item in pop-up menu for options is selected.

Returns:
the condition about function existence

isSelectedNumberOfOccurrences

public boolean isSelectedNumberOfOccurrences()
Checks whether number of occurrences in function panel is selected.

Returns:
condition about visibility of number of occurrences

isSelectedUpdateDynamically

public boolean isSelectedUpdateDynamically()
Checks whether UpdateDynamically toggle button is pressed.

Returns:
the condition to update dynamically the report

isSelectedPrintColumnNames

public boolean isSelectedPrintColumnNames()
Checks whether column names are printed.

Returns:
the condition to update dynamically the report

existVirtualColumns

public boolean existVirtualColumns()
Checks whether exist virtual columns. Virtual columns are columns added automatically to allow grouping by month, year, ... in date columns.

Returns:
Condition about existence of virtual columns

isVirtualColumn

public boolean isVirtualColumn(java.lang.String column)
Checks whether the column parameter is a virtual column.

Parameters:
column - The name of column
Returns:
The condition

isBaseColumnFromVirtualColumn

public boolean isBaseColumnFromVirtualColumn(java.lang.String column)
Checks whether a column is the original column for a virtual column.

Returns:

clearVirtualColumns

public void clearVirtualColumns()
Clear table model and virtual columns Hashtable..


buildOptions

public void buildOptions()
Creates the JPopUpMenu for options: include row number, show column names,...

Specified by:
buildOptions in interface ReportEngine

isImageColumn

public boolean isImageColumn(java.lang.Class imageClass)
Checks whether column class is sun.awt.image.ToolkitImage. It is used to allow rendering images in report.

Parameters:
imageClass - the class for image.
Returns:
the condition for column class

isDateColumn

public boolean isDateColumn(java.lang.Class dateClass)
Checks whether column class is a Date. .

Parameters:
dateClass - the class for image.
Returns:
the condition for column class

getTextOperation

public java.lang.String getTextOperation(java.lang.Integer operation)
Gets the text for operation applied in column

Parameters:
operation - The operation
Returns:
The text for operation parameter

getOperation

public DJCalculation getOperation(java.lang.Integer operation)
Gets the operation to use in variables of footer (SUM, MAX, MIN, AVG).

Parameters:
operation - the operation
Returns:
the correspondent DJCalculation object.

getReportEngineName

public java.lang.String getReportEngineName()
Returns the name of report Engine: "DynamicJasper".

Specified by:
getReportEngineName in interface ReportEngine
Returns:
the name of report engine configured

checkLibraries

public boolean checkLibraries()
Requires:

Specified by:
checkLibraries in interface ReportEngine
Returns:
the condition of availability of libraries.

checkJasperLibraries

public static boolean checkJasperLibraries()

createTableModel

public static javax.swing.table.TableModel createTableModel(java.util.Hashtable res,
                                                            boolean returnEmptyStrings,
                                                            boolean convertBB2Im,
                                                            boolean convertBooleanToIm)
Creates a table model that replaces complete null columns by empty strings.

Returns:
the table model with data.

viewJasperDialog

public void viewJasperDialog(java.lang.String template)
                      throws java.lang.Exception
Views jasper dialog from a .jrxml template.

Parameters:
template - the .jrxml template
Throws:
java.lang.Exception - When a Jasper Exception occurs

viewJasperDialog

public void viewJasperDialog(java.lang.String template,
                             java.lang.String title)
                      throws java.lang.Exception
Fills and views jasper report from a compiled report template without jasper parameters.

Parameters:
template - Complete path to the compiled report
title - of window where report is showed
Throws:
java.lang.Exception - When a Jasper Exception occurs

viewJasperDialog

public void viewJasperDialog(java.awt.Component parent,
                             java.lang.String template,
                             java.lang.String title)
                      throws java.lang.Exception
Fills and views jasper report from a compiled report template without jasper parameters.

Parameters:
template - Complete path to the compiled report
title - of window where report is showed
Throws:
java.lang.Exception - When a Jasper Exception occurs

viewJasperDialog

public void viewJasperDialog(java.net.URL template,
                             java.util.Hashtable data,
                             java.util.Hashtable reportParameters)
                      throws java.lang.Exception
Views jasper dialog from a URL where is the template.

Parameters:
template - URL where is the template.
data - Hashtable or EntityResult with data.
Throws:
java.lang.Exception - Never throws Exception. When an Exception occurs filling report is catched internally

viewJasperDialog

public void viewJasperDialog(java.net.URL template,
                             javax.swing.table.TableModel dataModel,
                             java.util.Hashtable reportParameters)
                      throws java.lang.Exception
Views jasper dialog from a URL where is the template.

Parameters:
template - URL where is the template.
Throws:
java.lang.Exception - Never throws Exception. When an Exception occurs filling report is catched internally

viewJasperDialog

public void viewJasperDialog(java.net.URL template,
                             javax.swing.table.TableModel dataModel,
                             java.lang.String title,
                             java.util.Hashtable reportParameters)
                      throws java.lang.Exception
Views jasper dialog from a URL where is the template.

Parameters:
template - URL where is the template.
Throws:
java.lang.Exception - Never throws Exception. When an Exception occurs filling report is catched internally

viewJasperDialog

public void viewJasperDialog(java.awt.Component parent,
                             java.net.URL template,
                             javax.swing.table.TableModel dataModel,
                             java.lang.String title,
                             java.util.Hashtable reportParameters)
                      throws java.lang.Exception
Views jasper dialog from a URL where is the template.

Parameters:
template - URL where is the template.
Throws:
java.lang.Exception - Never throws Exception. When an Exception occurs filling report is catched internally

getMultiGroupColumns

public java.util.List getMultiGroupColumns()

getVirtualColumns

public java.util.Hashtable getVirtualColumns()

isColumnGroupInSimpleGroup

public boolean isColumnGroupInSimpleGroup(java.lang.String groupColumn)

viewJasperDialog

public void viewJasperDialog(java.net.URL template)
                      throws java.lang.Exception
Fills and view report from template that contains compiled report without parameters.

Parameters:
template - The complete url to compiled report
Throws:
java.lang.Exception - When occurs an Exception filling report

viewJasperDialog

public void viewJasperDialog(java.awt.Component parent,
                             java.net.URL template)
                      throws java.lang.Exception
Fills and view report from template that contains compiled report without parameters.

Parameters:
parent - Parent component to report
template - The complete url to compiled report
Throws:
java.lang.Exception - When occurs an Exception filling report

showPreviewDialog

public PreviewDialog showPreviewDialog(java.awt.Component c,
                                       java.lang.String title,
                                       javax.swing.table.TableModel m,
                                       java.lang.String template,
                                       java.net.URL base)
                                throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must show a dialog with printed report. Not all parameters are required

Specified by:
showPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

showPreviewDialog

public PreviewDialog showPreviewDialog(java.awt.Component c,
                                       java.lang.String title,
                                       javax.swing.table.TableModel m,
                                       java.net.URL template,
                                       java.net.URL base)
                                throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must show a dialog with printed report. Not all parameters are required

Specified by:
showPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

showPreviewDialog

public PreviewDialog showPreviewDialog(java.awt.Component c,
                                       java.lang.String title,
                                       javax.swing.table.TableModel m,
                                       java.lang.String template,
                                       java.net.URL base,
                                       ReportProcessor rp)
                                throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must show a dialog with printed report. Not all parameters are required

Specified by:
showPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

showPreviewDialog

public PreviewDialog showPreviewDialog(java.awt.Component c,
                                       java.lang.String title,
                                       javax.swing.table.TableModel m,
                                       java.net.URL template,
                                       java.net.URL base,
                                       ReportProcessor rp)
                                throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must show a dialog with printed report. Not all parameters are required

Specified by:
showPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

showPreviewDialog

public PreviewDialog showPreviewDialog(java.awt.Component c,
                                       java.lang.String title,
                                       javax.swing.table.TableModel m,
                                       java.net.URL template,
                                       java.net.URL base,
                                       java.lang.String[] order,
                                       boolean[] asc)
                                throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must show a dialog with printed report. Not all parameters are required

Specified by:
showPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

showPreviewDialog

public PreviewDialog showPreviewDialog(java.awt.Component c,
                                       java.lang.String title,
                                       javax.swing.table.TableModel m,
                                       java.net.URL template,
                                       java.net.URL base,
                                       java.lang.String[] order,
                                       boolean[] asc,
                                       ReportProcessor rp)
                                throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must show a dialog with printed report. Not all parameters are required

Specified by:
showPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

showPreviewDialog

public PreviewDialog showPreviewDialog(java.awt.Component c,
                                       java.lang.String title,
                                       javax.swing.table.TableModel m,
                                       java.net.URL template,
                                       java.net.URL base,
                                       java.lang.String[] order,
                                       boolean[] asc,
                                       ReportProcessor rp,
                                       java.awt.print.PageFormat pf)
                                throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must show a dialog with printed report. Not all parameters are required

Specified by:
showPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

getPreviewDialog

public PreviewDialog getPreviewDialog(java.awt.Component c,
                                      java.lang.String title,
                                      javax.swing.table.TableModel m,
                                      java.net.URL template,
                                      java.net.URL base,
                                      ReportProcessor r)
                               throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must return a dialog with printed report. Not all parameters are required

Specified by:
getPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

getPreviewDialog

public PreviewDialog getPreviewDialog(java.awt.Component c,
                                      java.lang.String title,
                                      javax.swing.table.TableModel m,
                                      java.net.URL template,
                                      java.net.URL base)
                               throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must return a dialog with printed report. Not all parameters are required

Specified by:
getPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

getPreviewDialog

public PreviewDialog getPreviewDialog(java.awt.Component c,
                                      java.lang.String title,
                                      javax.swing.table.TableModel m,
                                      java.net.URL template,
                                      java.net.URL base,
                                      java.lang.String[] order,
                                      boolean[] asc)
                               throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must return a dialog with printed report. Not all parameters are required

Specified by:
getPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

getPreviewDialog

public PreviewDialog getPreviewDialog(java.awt.Component c,
                                      java.lang.String title,
                                      javax.swing.table.TableModel m,
                                      java.net.URL template,
                                      java.net.URL base,
                                      java.lang.String[] order,
                                      boolean[] asc,
                                      ReportProcessor r)
                               throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must return a dialog with printed report. Not all parameters are required

Specified by:
getPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

getPreviewDialog

public PreviewDialog getPreviewDialog(java.awt.Component c,
                                      java.lang.String title,
                                      javax.swing.table.TableModel m,
                                      java.net.URL template,
                                      java.net.URL base,
                                      java.lang.String[] order,
                                      boolean[] asc,
                                      ReportProcessor r,
                                      java.awt.print.PageFormat pf)
                               throws java.lang.Exception
Description copied from interface: ReportEngine
Implementation of this method for each engine must return a dialog with printed report. Not all parameters are required

Specified by:
getPreviewDialog in interface ReportEngine
Throws:
java.lang.Exception

getMonthText

public java.lang.String getMonthText(int month)

getQuarterText

public java.lang.String getQuarterText(int quarter)

Ontimize