public class DynamicJasperEngine extends Object implements ReportEngine, IGroupByDate, Internationalization
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()| Modifier and Type | Field and Description |
|---|---|
static String |
APRIL |
static String |
AUGUST |
protected boolean |
bPreviousEvaluation |
protected static boolean |
checkJasperLibreries |
static int |
columnWidth |
static String |
dateNameSeparator |
static String |
DEBUG |
static String |
DECEMBER |
static int |
DEFAULT_COLUMN_WIDTH |
static String |
DEFAULT_JRXML_TEMPLATE_LANDSCAPE |
static String |
DEFAULT_JRXML_TEMPLATE_LANDSCAPE_NO_LOGO |
static String |
DEFAULT_JRXML_TEMPLATE_PORTRAIT |
static String |
DEFAULT_JRXML_TEMPLATE_PORTRAIT_NO_LOGO |
static int |
DEFAULT_PADDING_FOR_GROUPS |
static int |
DEFAULT_WIDTH_ROW_NUMBERS |
protected ar.com.fdvs.dj.domain.Style |
defaultColumnDataStyle |
protected ar.com.fdvs.dj.domain.Style |
defaultHeaderForGroupStyle |
protected ar.com.fdvs.dj.domain.Style |
defaultHeaderForMultiGroupStyle |
protected ar.com.fdvs.dj.domain.Style |
defaultHeaderStyle |
protected ar.com.fdvs.dj.domain.Style |
defaultSubtitleStyle |
protected ar.com.fdvs.dj.domain.Style |
defaultTitleStyle |
static int |
defaultVirtualizerCacheSize |
protected ar.com.fdvs.dj.domain.DynamicReport |
dr |
protected CustomDynamicReportBuilder |
drb
Builder for reports, with this instance is built the report.
|
String |
dynamicGroupIdentifier |
protected EntityResult |
erData |
protected TableModelDataSource |
erDataSource
Objects that implements Jasper interface
JRDataSource to
store report data. |
static String |
ERROR |
static String |
FATAL |
static String |
FEBRUARY |
static String |
FIRST_QUARTER |
static String |
FOURTH_QUARTER |
protected ar.com.fdvs.dj.domain.builders.GroupBuilder |
gb1
Group builder
|
static String |
GROUP_BY_DEFAULT |
static String |
GROUP_COUNT_LABEL |
static String |
groupCloseCharacter |
static String |
groupDateSeparator |
static String |
groupOpenCharacter |
protected Hashtable |
hColsPositions |
protected Hashtable |
hMultiGroupColumns |
protected Hashtable |
hRenderColumns |
protected Hashtable |
hVirtualColumns
It contains the equivalences between column and its virtualcolumn.
|
static 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 String |
JANUARY |
protected static boolean |
jasperLibreries |
protected net.sf.jasperreports.engine.JasperPrint |
jp |
static String |
JULY |
static String |
JUNE |
static String |
logLevel |
static String |
MARCH |
static String |
MAY |
protected TableModel |
model |
static String |
NOVEMBER |
static 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 String |
OCTOBER |
protected ar.com.fdvs.dj.domain.Style |
oddRowBackgroundStyle |
static int |
paddingForGroups |
protected 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 String |
reportLogoOnlyForFirstPage |
static String |
reportLogoPath |
protected EntityResult |
resultmodel |
static String |
SECOND_QUARTER |
static String |
SEPTEMBER |
protected String |
sHeaderGroupingDate |
protected TableSorter |
sortermodel |
protected ar.com.fdvs.dj.domain.Style |
styleFooterVariable |
protected ar.com.fdvs.dj.domain.Style |
styleGroupFooterNumberOcurrencesVariable |
protected ar.com.fdvs.dj.domain.Style |
styleGroupFooterVariable |
static String |
THIRD_QUARTER |
static String |
TRACE |
static boolean |
useTemplatesWithDefaultLogo |
static boolean |
useVirtualizerByDefault |
protected CustomJasperViewer |
viewer |
static String |
VIRTUAL_ORDERING_SUFFIX |
static String |
VIRTUAL_SUFFIX
Suffix added to virtual column at the end.
|
protected net.sf.jasperreports.engine.JRVirtualizer |
virtualizer |
List |
vMultiGroupColumns |
static String |
WARN |
static int |
widthRowNumbers |
DEBUG_LANGUAGE| Constructor and Description |
|---|
DynamicJasperEngine() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyFunctionForColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
ar.com.fdvs.dj.domain.builders.GroupBuilder group)
Apply function for a specific column.
|
void |
buildColumns()
It is the method called to build columns in report
|
protected ar.com.fdvs.dj.domain.builders.GroupBuilder |
buildGroup(int groupIndex,
String groupColumn,
Class groupClass)
Internal method used to create a group.
|
void |
buildGroups()
Build groups from selected group columns.
|
protected ar.com.fdvs.dj.domain.builders.GroupBuilder |
buildMultiGroup(int groupIndex,
Vector groupColumns,
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.
|
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn |
configureColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
String columnName,
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)
|
ar.com.fdvs.dj.domain.builders.ColumnBuilder |
configureColumnBuilder(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
String columnName,
Class columnClass)
Sets the property for column builder.
|
protected void |
configureColumnRenders() |
ar.com.fdvs.dj.domain.builders.GroupBuilder |
configureGroupBuilder(ar.com.fdvs.dj.domain.builders.GroupBuilder gb1,
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
int groupIndex)
Configures group builder for single groups
|
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn |
configureGroupColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
String groupColumn,
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. |
ar.com.fdvs.dj.domain.builders.ColumnBuilder |
configureGroupColumnBuilder(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
String groupColumn,
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(ar.com.fdvs.dj.domain.builders.GroupBuilder gb1,
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column)
Configures and applies variables in group footer.
|
void |
configureGroupNumberOfOcurrencesLabel(ar.com.fdvs.dj.domain.builders.GroupBuilder gb1,
String groupColumn)
Creates and sets the label to group indicating the number of ocurrences.
|
ar.com.fdvs.dj.domain.builders.GroupBuilder |
configureMultiGroupBuilder(ar.com.fdvs.dj.domain.builders.GroupBuilder gb1,
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
boolean multiGroupContainsSubgroups)
Configures group builder for multiple groups
|
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn |
configureMultiGroupColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
String groupColumn,
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. |
ar.com.fdvs.dj.domain.builders.ColumnBuilder |
configureMultiGroupColumnBuilder(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
String groupColumn,
Class groupClass,
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 Vector |
configureMultiGroupColumnClasses(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,
String columnName,
Class columnClass)
Create and register a hidden virtual column for dates.
|
ar.com.fdvs.dj.domain.Style |
createColumnDataStyle(Class columnClass)
Sets the style for report layout: font, padding, alignment.
|
String |
createDatePattern(DateCellRenderer rendererColumn) |
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 TableModel |
createTableModel(Hashtable res,
boolean returnEmptyStrings,
boolean convertBB2Im,
boolean convertBooleanToIm)
Creates a table model that replaces complete null columns by empty
strings.
|
void |
createViewer(net.sf.jasperreports.engine.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(ar.com.fdvs.dj.domain.entities.columns.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(String pageTitle)
Not implemented.
|
protected void |
generateOtherMultiGroupColumns(Vector groupColumns,
Vector groupClasses)
Parameter groupColumns contains all columns to create the multigroup.
|
Object |
generateReport(String pageTitle,
String description)
This method builds report.
|
Vector |
generateVirtualColumnValues(String column,
Vector originalColumnValues) |
Object |
getBaseTemplate()
Returns the viewer.
|
Class |
getColumnClassForColumn(String columnName)
This method iterates in model and returns th class of column passed in
parameter.
|
String |
getColumnFromVirtualColumn(String virtualColumn)
Gets identifier for column from virtual column.
|
int |
getColumnIndex(String columnName,
TableModel model)
Get column index associated with
columnName in a particular
table model. |
protected String |
getColumnPatternFromRenderer(TableCellRenderer rendererColumn) |
Hashtable |
getColumnWidth() |
protected TableModel |
getDataModel(boolean ascending)
Gets the model with data for report.
|
TableModel |
getDataModelWithVirtualColumns() |
String |
getDatePattern()
Returns a date pattern locale-dependent.
|
List |
getDefaultTemplates()
Returns the default templates.
|
ar.com.fdvs.dj.domain.DynamicReport |
getDynamicReport() |
String |
getEvaluationValueForGroupingDate(Map fields,
String groupColumn)
This method performs operation to return a string with values for
grouping dates.
|
ar.com.fdvs.dj.domain.CustomExpression |
getExpressionForRowNumbers()
This method gets values to add the row number in report.
|
String |
getGroupedKey(String groupColumn)
Gets the text showed in grouping dates.
|
String |
getGroupIdentifier(String groupColumn)
Gets the group identifier.
|
String |
getGroupingDatePattern() |
String |
getGroupingDateTimePattern() |
ar.com.fdvs.dj.domain.constants.GroupLayout |
getGroupLayoutForColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column)
Obtains the layout for a determined group.
|
ar.com.fdvs.dj.domain.constants.GroupLayout |
getGroupLayoutForMultiGroup(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
boolean multiGroupContainsSubgroups)
Get group layout for multigroup.
|
protected ar.com.fdvs.dj.core.layout.LayoutManager |
getLayoutManager()
Gets the manager that controls the layout of report.
|
String |
getMonthText(int month) |
List |
getMultiGroupColumns() |
Vector |
getMultiGroupColumnsForColumn(String initialMultiColumn)
Gets the vector with columns in multigroup from the initial column of
multigroup
|
protected Object |
getMultigroupExpression(List groupColumns,
Map fields,
Map variables,
Map parameters)
This method performs operation to return a string with values for
grouping with multiple columns.
|
ar.com.fdvs.dj.domain.DJCalculation |
getOperation(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.
|
String |
getPageTitle()
Gets the text of title field.
|
Hashtable |
getParameters()
Returns the parameters that are passed to report.
|
String |
getPatternForColumn(String columnName) |
PreviewDialog |
getPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base)
Implementation of this method for each engine must return a dialog with
printed report.
|
PreviewDialog |
getPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base,
ReportProcessor r)
Implementation of this method for each engine must return a dialog with
printed report.
|
PreviewDialog |
getPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base,
String[] order,
boolean[] asc)
Implementation of this method for each engine must return a dialog with
printed report.
|
PreviewDialog |
getPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base,
String[] order,
boolean[] asc,
ReportProcessor r)
Implementation of this method for each engine must return a dialog with
printed report.
|
PreviewDialog |
getPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base,
String[] order,
boolean[] asc,
ReportProcessor r,
PageFormat pf)
Implementation of this method for each engine must return a dialog with
printed report.
|
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).
|
String |
getReportDescription()
Gets the text of subtitle field.
|
String |
getReportEngineName()
Returns the name of report Engine: "DynamicJasper".
|
String |
getTextOperation(Integer operation)
Gets the text for operation applied in column
|
Vector |
getTextsToTranslate()
Returns all the texts in the element suitable for being translated.
|
String |
getTitle()
Convenience method.
|
String |
getVirtualColumn(String currentGroupItem)
Returns the identifier for virtual column addign to
currentGroupItem the suffix indicated by variable:
VIRTUAL_SUFFIX |
String |
getVirtualColumnForOrdering(String virtualColumn)
Returns the identifier for virtual column used for ordering to
virtualColumn the suffix indicated by variable:
IRTUAL_ORDERING_SUFFIX |
Hashtable |
getVirtualColumns() |
String |
getXMLTemplate() |
boolean |
isBaseColumnFromVirtualColumn(String column)
Checks whether a column is the original column for a virtual column.
|
boolean |
isBooleanImageColumn(Class booleanImageClass)
Checks whether column class is a BooleanImage.
|
boolean |
isColumnGroupInSimpleGroup(String groupColumn) |
boolean |
isDateColumn(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(Class imageClass)
Checks whether column class is
sun.awt.image.ToolkitImage. |
boolean |
isMoreInternalGroup(ar.com.fdvs.dj.domain.entities.DJGroup group)
Checks whether the group indicated by groupindex is the most internal in
layout.
|
boolean |
isMoreInternalGroup(int groupindex)
Checks whether the group indicated by groupindex is the most internal in
layout.
|
boolean |
isNumericClass(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 |
isSelectedShowGrid()
Checks whether show grid option is selected.
|
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(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(net.sf.jasperreports.engine.JasperPrint jp)
Refreshes the viewer for a specific jasper print passed in parameter.
|
CustomDynamicReportBuilder |
registerField(String columnName,
Class columnClass)
Register a field in report.
|
void |
setColumnDataStyle()
Sets the style for report layout: font, padding, alignment.
|
ar.com.fdvs.dj.domain.builders.ColumnBuilder |
setColumnGroupClass(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
String groupColumn,
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.
|
void |
setComponentLocale(Locale l) |
ar.com.fdvs.dj.domain.builders.ColumnBuilder |
setDateGroupingExpression(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
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(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(ar.com.fdvs.dj.domain.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(String logLevel)
Sets log level for this engine.
|
void |
setParameters(Hashtable parameters)
Adds the specified parameters to report.
|
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn |
setPatterns(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
Class columnClass) |
void |
setReportDescription(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 |
setResourceBundle(ResourceBundle resourceBundle)
Sets the language resource bundle.
|
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(String text)
Sets the title of report.
|
PreviewDialog |
showPreviewDialog(Component c,
String title,
TableModel m,
String template,
URL base)
Implementation of this method for each engine must show a dialog with
printed report.
|
PreviewDialog |
showPreviewDialog(Component c,
String title,
TableModel m,
String template,
URL base,
ReportProcessor rp)
Implementation of this method for each engine must show a dialog with
printed report.
|
PreviewDialog |
showPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base)
Implementation of this method for each engine must show a dialog with
printed report.
|
PreviewDialog |
showPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base,
ReportProcessor rp)
Implementation of this method for each engine must show a dialog with
printed report.
|
PreviewDialog |
showPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base,
String[] order,
boolean[] asc)
Implementation of this method for each engine must show a dialog with
printed report.
|
PreviewDialog |
showPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base,
String[] order,
boolean[] asc,
ReportProcessor rp)
Implementation of this method for each engine must show a dialog with
printed report.
|
PreviewDialog |
showPreviewDialog(Component c,
String title,
TableModel m,
URL template,
URL base,
String[] order,
boolean[] asc,
ReportProcessor rp,
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(Component parent,
String template,
String title)
Fills and views jasper report from a compiled report template without
jasper parameters.
|
void |
viewJasperDialog(Component parent,
URL template)
Fills and view report from template that contains compiled report
without parameters.
|
void |
viewJasperDialog(Component parent,
URL template,
TableModel dataModel,
String title,
Hashtable reportParameters)
Views jasper dialog from a URL where is the template.
|
void |
viewJasperDialog(String template)
Views jasper dialog from a .jrxml template.
|
void |
viewJasperDialog(String template,
String title)
Fills and views jasper report from a compiled report template without
jasper parameters.
|
void |
viewJasperDialog(URL template)
Fills and view report from template that contains compiled report
without parameters.
|
void |
viewJasperDialog(URL template,
Hashtable data,
Hashtable reportParameters)
Views jasper dialog from a URL where is the template.
|
void |
viewJasperDialog(URL template,
TableModel dataModel,
Hashtable reportParameters)
Views jasper dialog from a URL where is the template.
|
void |
viewJasperDialog(URL template,
TableModel dataModel,
String title,
Hashtable reportParameters)
Views jasper dialog from a URL where is the template.
|
public static final String TRACE
public static final String DEBUG
public static final String INFO
public static final String WARN
public static final String ERROR
public static final String FATAL
public static String logLevel
public static final String GROUP_COUNT_LABEL
protected TableModelDataSource erDataSource
JRDataSource to
store report data.public static final int DEFAULT_PADDING_FOR_GROUPS
public static final int DEFAULT_WIDTH_ROW_NUMBERS
public static final int DEFAULT_COLUMN_WIDTH
public static int paddingForGroups
public static int widthRowNumbers
public static int columnWidth
public static boolean useTemplatesWithDefaultLogo
public static String reportLogoPath
public static String reportLogoOnlyForFirstPage
public String dynamicGroupIdentifier
public static final String DEFAULT_JRXML_TEMPLATE_PORTRAIT
public static final String DEFAULT_JRXML_TEMPLATE_LANDSCAPE
public static final String DEFAULT_JRXML_TEMPLATE_PORTRAIT_NO_LOGO
public static final String DEFAULT_JRXML_TEMPLATE_LANDSCAPE_NO_LOGO
public static final String JANUARY
public static final String FEBRUARY
public static final String MARCH
public static final String APRIL
public static final String MAY
public static final String JUNE
public static final String JULY
public static final String AUGUST
public static final String SEPTEMBER
public static final String OCTOBER
public static final String NOVEMBER
public static final String DECEMBER
public static final String FIRST_QUARTER
public static final String SECOND_QUARTER
public static final String THIRD_QUARTER
public static final String FOURTH_QUARTER
public static String dateNameSeparator
public static String groupDateSeparator
public static String groupOpenCharacter
public static String groupCloseCharacter
public static String GROUP_BY_DEFAULT
public static String VIRTUAL_SUFFIX
public static String VIRTUAL_ORDERING_SUFFIX
protected DefaultReportDialog reportDialog
protected CustomDynamicReportBuilder drb
protected ar.com.fdvs.dj.domain.DynamicReport dr
protected TableModel model
protected TableSorter sortermodel
protected EntityResult erData
protected boolean isfocusAdapterAdded
protected boolean bPreviousEvaluation
protected String sHeaderGroupingDate
protected EntityResult resultmodel
protected Hashtable parameters
protected Hashtable hColsPositions
protected Hashtable hMultiGroupColumns
protected Hashtable hRenderColumns
protected CustomJasperViewer viewer
protected net.sf.jasperreports.engine.JasperPrint jp
protected ar.com.fdvs.dj.domain.builders.GroupBuilder gb1
public List vMultiGroupColumns
protected Hashtable hVirtualColumns
Hashtable is added an entry (original_column ,
original_column + VIRTUAL_SUFFIX).protected ar.com.fdvs.dj.domain.Style defaultTitleStyle
protected ar.com.fdvs.dj.domain.Style defaultSubtitleStyle
protected ar.com.fdvs.dj.domain.Style defaultHeaderStyle
protected ar.com.fdvs.dj.domain.Style defaultHeaderForGroupStyle
protected ar.com.fdvs.dj.domain.Style defaultHeaderForMultiGroupStyle
protected ar.com.fdvs.dj.domain.Style defaultColumnDataStyle
protected ar.com.fdvs.dj.domain.Style oddRowBackgroundStyle
protected ar.com.fdvs.dj.domain.Style styleFooterVariable
protected ar.com.fdvs.dj.domain.Style styleGroupFooterVariable
protected ar.com.fdvs.dj.domain.Style styleGroupFooterNumberOcurrencesVariable
protected net.sf.jasperreports.engine.JRVirtualizer virtualizer
public static boolean useVirtualizerByDefault
public static boolean isShowedDateInReportFooterByDefault
public static boolean isShowedPageInReportFooterByDefault
public static boolean isShowedTitleByDefault
public static boolean isShowedSubtitleByDefault
public static int defaultVirtualizerCacheSize
protected boolean isUsedVirtualizer
protected boolean isRegisteredVirtualizer
protected boolean isShowedDateInReportFooter
protected boolean isShowedPageInReportFooter
protected boolean isShowedTitle
protected boolean isShowedSubtitle
@Deprecated public static String numericPattern
protected static boolean checkJasperLibreries
protected static boolean jasperLibreries
public static void setLogLevel(String logLevel)
logLevel - the String with error level.public void close()
ReportEngineclose in interface ReportEnginepublic void dispose()
dispose in interface ReportEnginepublic BasicReportStoreDefinition generaReportStoreDefinition(String pageTitle)
generaReportStoreDefinition in interface ReportEnginepageTitle - the title of pageprotected ar.com.fdvs.dj.core.layout.LayoutManager getLayoutManager()
public void createModel()
DefaultReportDialog#getOrderedDataModel(boolean)}public void createVirtualColumns()
public TableModel getDataModelWithVirtualColumns()
public String getGroupingDateTimePattern()
public String getGroupingDatePattern()
public ar.com.fdvs.dj.domain.entities.columns.AbstractColumn setPatterns(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
Class columnClass)
public Vector generateVirtualColumnValues(String column, Vector originalColumnValues)
public void createReportBuilder()
public ar.com.fdvs.dj.domain.DynamicReport getDynamicReport()
public void setDynamicReport(ar.com.fdvs.dj.domain.DynamicReport dr)
public Object generateReport(String pageTitle, String description) throws Exception
generateReport in interface ReportEnginepageTitle - the title of reportdescription - subtitle of reportException - A new Exceptionpublic void clearReportVariables()
public void setReportLogo()
public Object getBaseTemplate()
getBaseTemplate in interface ReportEnginepublic String getPageTitle()
getPageTitle in interface ReportEnginepublic String getReportDescription()
getReportDescription in interface ReportEnginepublic int getColumnIndex(String columnName, TableModel model)
columnName in a particular
table model.columnName - The name of columnmodel - Data modelprotected TableModel getDataModel(boolean ascending)
getRealNumberOfGroups()).ascending - the order for datapublic TableSorter getOrderedDataModel(boolean ascending)
ascending - condition to ascending-descending order.com.ontimize.report.TableSorter with orderpublic String getTitle()
getTitle in interface ReportEnginepublic void setDefaultReportDialog(Object reportDialog)
ReportEnginesetDefaultReportDialog in interface ReportEnginereportDialog - the report dialog to be used in engine.public void setTitleReport(String text)
ReportEnginesetTitleReport in interface ReportEnginetext - the text to set in titlepublic void setReportDescription(String text)
ReportEnginesetReportDescription in interface ReportEnginetext - the text to set in titlepublic void updateReport(boolean force)
updateReport in interface ReportEngine - public void setParameters(Hashtable parameters)
parameters - public Hashtable getParameters()
public String getDatePattern()
public void setDefaultParameters()
public boolean isUsedVirtualizer()
public void setIsUsedVirtualizer(boolean isUsedVirtualizer)
isUsedVirtualizer - Condition to use virtualizerspublic boolean isShowedDateInReportFooter()
public void setShowedDateInReportFooter(boolean isShowedDateInReportFooter)
isShowedDateInReportFooter - the variable to show/hide date in report footerpublic boolean isShowedPageInReportFooter()
public boolean isShowedTitle()
public boolean isShowedSubtitle()
public void setShowedPageInReportFooter(boolean isShowedPageInReportFooter)
isShowedPageInReportFooter - The variable to show/hide page in report footerpublic void createViewer(net.sf.jasperreports.engine.JasperPrint jp,
DefaultReportDialog reportDialog)
jp - the jasperprint objectreportDialog - the dialog where viewer is addedpublic void refreshOntimizeViewer()
public void refreshOntimizeViewer(net.sf.jasperreports.engine.JasperPrint jp)
public List getDefaultTemplates()
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.getDefaultTemplates in interface ReportEngineList with default templates.public void setReportStyles()
public void setTitleandSubtitleStyle()
public void setColumnHeaderStyle()
public void setColumnDataStyle()
public ar.com.fdvs.dj.domain.Style createColumnDataStyle(Class columnClass)
public void setColumnHeaderForGroupsStyle()
public void setColumnHeaderForMultiGroupsStyle()
public void setFooterVariableStyle()
public void setGroupFooterVariableStyle()
public void setGroupFooterNumberOcurrencesVariableStyle()
public void setRowReportSyles()
public void buildReportFooter()
setDefaultParameters() passed to report, so this method is empty
in this implementationpublic void buildReportHeader()
public void buildReportDetail()
throws Exception
Exception - when an Exception is thrown.protected void configureColumnRenders()
protected String getColumnPatternFromRenderer(TableCellRenderer rendererColumn)
public String createDatePattern(DateCellRenderer rendererColumn)
public String createDecimalPattern(RealCellRenderer rendererColumn)
public void configureTemplate()
throws Exception
Exception - When template is not selected.public ar.com.fdvs.dj.domain.CustomExpression getExpressionForRowNumbers()
public void buildColumns()
throws Exception
Exception - when an Exception occurspublic CustomDynamicReportBuilder configureVirtualColumn(CustomDynamicReportBuilder drb, String columnName, Class columnClass) throws Exception
drb - columnName - columnClass - Exceptionpublic CustomDynamicReportBuilder registerField(String columnName, Class columnClass)
columnName - The column name referred to fieldcolumnClass - The class of columnpublic ar.com.fdvs.dj.domain.entities.columns.AbstractColumn configureColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
String columnName,
Class columnClass)
column - The initial columncolumnName - The column namepublic ar.com.fdvs.dj.domain.builders.ColumnBuilder configureColumnBuilder(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
String columnName,
Class columnClass)
cb - The original column builder for this columncolumnName - The name of the columncolumnClass - The class of the columnpublic void keepOriginalColumnPositions(int i)
Hashtable hColsPositions the original order in
columns. This order is required in layout to be printed correctly.i - Index of columnpublic void createRowNumberColumn()
throws ar.com.fdvs.dj.domain.builders.ColumnBuilderException
ar.com.fdvs.dj.domain.builders.ColumnBuilderExceptionpublic boolean existFunctionForColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column)
column - the column to checkpublic boolean isNumericClass(Object classparameter)
classparameter - the class to checkpublic Class getColumnClassForColumn(String columnName)
columnName - The name of columnpublic boolean isSelectedMultiGrouping()
public void applyFunctionForColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
ar.com.fdvs.dj.domain.builders.GroupBuilder group)
throws Exception
Exceptionpublic String getEvaluationValueForGroupingDate(Map fields, String groupColumn)
fields - All fields in reportgroupColumn - The column to be groupedParseExceptionprotected Object getMultigroupExpression(List groupColumns, Map fields, Map variables, Map parameters)
groupColumns - The list of group columnsfields - Fields in reportvariables - Variables in reportparameters - Report parametersprotected ar.com.fdvs.dj.domain.builders.GroupBuilder buildMultiGroup(int groupIndex,
Vector groupColumns,
Vector groupClasses,
boolean multiGroupContainsSubgroups)
throws Exception
groupIndex - Index in group criteria in group columnsgroupColumn - Name of criteria to group bygroupClass - Class for group criteriamultiGroupContainsSubgroups - This condition is true when a multigroup is parent of another
groupsGroupBuilder with groupsException - A Exception when group cannot be created.protected Vector configureMultiGroupColumnClasses(Vector groupClasses)
groupClasses - The group classes for a multi groupprotected void generateOtherMultiGroupColumns(Vector groupColumns, Vector groupClasses)
Hashtable
hMultiGroupColumns with key the first column of multigroup (first in
group list) and value other multigroup columns.groupColumns - Multi group columnsgroupClasses - Multi group classespublic Vector getMultiGroupColumnsForColumn(String initialMultiColumn)
initialMultiColumn - The columnprotected ar.com.fdvs.dj.domain.builders.GroupBuilder buildGroup(int groupIndex,
String groupColumn,
Class groupClass)
throws Exception
groupIndex - Index in group criteria in group columnsgroupColumn - Name of criteria to group bygroupClass - Class for group criteriaGroupBuilder with groupsException - A Exception when group cannot be created.public void configureGroupNumberOfOcurrencesLabel(ar.com.fdvs.dj.domain.builders.GroupBuilder gb1,
String groupColumn)
gb1 - The group buildergroupColumn - The group columnpublic void configureGroupFooterVariables(ar.com.fdvs.dj.domain.builders.GroupBuilder gb1,
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column)
throws Exception
gb1 - The group buildercolumn - Column that is the criteria for groupingException - when occurs an error configuring group builderpublic ar.com.fdvs.dj.domain.builders.GroupBuilder configureGroupBuilder(ar.com.fdvs.dj.domain.builders.GroupBuilder gb1,
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
int groupIndex)
gb1 - The initial group buildercolumn - Column that is the criteria for groupingpublic ar.com.fdvs.dj.domain.builders.GroupBuilder configureMultiGroupBuilder(ar.com.fdvs.dj.domain.builders.GroupBuilder gb1,
ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
boolean multiGroupContainsSubgroups)
gb1 - The initial group buildercolumn - Column that is the criteria for groupingmultiGroupContainsSubgroups - Checks whether group contains nested subgroupspublic ar.com.fdvs.dj.domain.entities.columns.AbstractColumn configureMultiGroupColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
String groupColumn,
Class groupClass,
int groupIndex)
column - The column to be configuredgroupColumn - The group columngroupClass - The group class for columngroupIndex - The number of group in report (Used for set width and
position)public ar.com.fdvs.dj.domain.entities.columns.AbstractColumn configureGroupColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
String groupColumn,
Class groupClass,
int groupIndex)
column - The column to be configuredgroupColumn - The group columngroupClass - The group class for columngroupIndex - The number of group in report (Used for set width and
position)public ar.com.fdvs.dj.domain.builders.ColumnBuilder configureMultiGroupColumnBuilder(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
String groupColumn,
Class groupClass,
Vector groupColumns)
cb - The initial column buildergroupColumn - The group columngroupClass - The group classgroupColumns - Other group columns that belongs to multiple grouppublic ar.com.fdvs.dj.domain.builders.ColumnBuilder configureGroupColumnBuilder(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
String groupColumn,
Class groupClass)
cb - The initial column buildergroupColumn - The group columngroupClass - The group classpublic String getGroupIdentifier(String groupColumn)
groupColumn - The name of columnpublic ar.com.fdvs.dj.domain.builders.ColumnBuilder setColumnGroupClass(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
String groupColumn,
Class groupClass)
cb - The column buildergroupColumn - The group columngroupClass - The group classpublic ar.com.fdvs.dj.domain.builders.ColumnBuilder setDateGroupingExpression(ar.com.fdvs.dj.domain.builders.ColumnBuilder cb,
String groupColumn)
String and date grouping
expression to column builder.cb - The column buildergroupColumn - Column to grouppublic String getGroupedKey(String groupColumn)
groupColumn - The name of group columnpublic void buildGroups()
throws Exception
Exception - Throws a ColumnBuilderException when occurs an
Error building columns for groups.public String getVirtualColumn(String currentGroupItem)
currentGroupItem the suffix indicated by variable:
VIRTUAL_SUFFIXcurrentGroupItem - Name of group columnpublic String getVirtualColumnForOrdering(String virtualColumn)
virtualColumn the suffix indicated by variable:
IRTUAL_ORDERING_SUFFIXcurrentGroupItem - Name of group columnpublic String getColumnFromVirtualColumn(String virtualColumn)
virtualColumn - The name of virtual columnpublic boolean isMoreInternalGroup(int groupindex)
i - The group indexpublic boolean isMoreInternalGroup(ar.com.fdvs.dj.domain.entities.DJGroup group)
i - The group indexpublic ar.com.fdvs.dj.domain.constants.GroupLayout getGroupLayoutForColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column)
column - the column to compute the layoutGroupLayout,
CustomGroupLayoutpublic ar.com.fdvs.dj.domain.constants.GroupLayout getGroupLayoutForMultiGroup(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn column,
boolean multiGroupContainsSubgroups)
column - Group column to check the layoutmultiGroupContainsSubgroups - Condition about existence of subgroups for a determined grouppublic boolean isShowedGroupDetails()
public boolean existGroups()
public int getRealNumberOfGroups()
public boolean isGroupColumnPrinted(int column)
column - the index of columnpublic boolean existFunctions()
public boolean isSelectedShowGrid()
public boolean isShowedRowNumber()
public boolean isSelectedNumberOfOccurrences()
public boolean isSelectedUpdateDynamically()
public boolean isSelectedPrintColumnNames()
public boolean existVirtualColumns()
public boolean isVirtualColumn(String column)
column - The name of columnpublic boolean isBaseColumnFromVirtualColumn(String column)
virtualColumn - VirtualColumnpublic void clearVirtualColumns()
Hashtable..public void buildOptions()
buildOptions in interface ReportEnginepublic boolean isImageColumn(Class imageClass)
sun.awt.image.ToolkitImage.
It is used to allow rendering images in report.imageClass - the class for image.public boolean isBooleanImageColumn(Class booleanImageClass)
booleanImageClass - the class for image.public boolean isDateColumn(Class dateClass)
dateClass - the class for date.public String getTextOperation(Integer operation)
operation - The operationpublic ar.com.fdvs.dj.domain.DJCalculation getOperation(Integer operation)
operation - the operationDJCalculation object.public String getReportEngineName()
getReportEngineName in interface ReportEnginepublic boolean checkLibraries()
checkLibraries in interface ReportEnginepublic static boolean checkJasperLibraries()
public static TableModel createTableModel(Hashtable res, boolean returnEmptyStrings, boolean convertBB2Im, boolean convertBooleanToIm)
public void viewJasperDialog(String template) throws Exception
template - the .jrxml templateException - When a Jasper Exception occurspublic void viewJasperDialog(String template, String title) throws Exception
template - Complete path to the compiled reporttitle - of window where report is showedException - When a Jasper Exception occurspublic void viewJasperDialog(Component parent, String template, String title) throws Exception
component - Complete path to the compiled reporttemplate - Complete path to the compiled reporttitle - of window where report is showedException - When a Jasper Exception occurspublic void viewJasperDialog(URL template, Hashtable data, Hashtable reportParameters) throws Exception
template - URL where is the template.data - Hashtable or EntityResult with data.Exception - Never throws Exception. When an Exception occurs filling
report is catched internallypublic void viewJasperDialog(URL template, TableModel dataModel, Hashtable reportParameters) throws Exception
template - URL where is the template.Exception - Never throws Exception. When an Exception occurs filling
report is catched internallypublic void viewJasperDialog(URL template, TableModel dataModel, String title, Hashtable reportParameters) throws Exception
template - URL where is the template.Exception - Never throws Exception. When an Exception occurs filling
report is catched internallypublic void viewJasperDialog(Component parent, URL template, TableModel dataModel, String title, Hashtable reportParameters) throws Exception
template - URL where is the template.Exception - Never throws Exception. When an Exception occurs filling
report is catched internallypublic List getMultiGroupColumns()
public Hashtable getVirtualColumns()
public boolean isColumnGroupInSimpleGroup(String groupColumn)
public void viewJasperDialog(URL template) throws Exception
template - The complete url to compiled reportException - When occurs an Exception filling reportpublic void viewJasperDialog(Component parent, URL template) throws Exception
parent - Parent component to reporttemplate - The complete url to compiled reportException - When occurs an Exception filling reportpublic PreviewDialog showPreviewDialog(Component c, String title, TableModel m, String template, URL base) throws Exception
ReportEngineshowPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog showPreviewDialog(Component c, String title, TableModel m, URL template, URL base) throws Exception
ReportEngineshowPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog showPreviewDialog(Component c, String title, TableModel m, String template, URL base, ReportProcessor rp) throws Exception
ReportEngineshowPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog showPreviewDialog(Component c, String title, TableModel m, URL template, URL base, ReportProcessor rp) throws Exception
ReportEngineshowPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog showPreviewDialog(Component c, String title, TableModel m, URL template, URL base, String[] order, boolean[] asc) throws Exception
ReportEngineshowPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog showPreviewDialog(Component c, String title, TableModel m, URL template, URL base, String[] order, boolean[] asc, ReportProcessor rp) throws Exception
ReportEngineshowPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog showPreviewDialog(Component c, String title, TableModel m, URL template, URL base, String[] order, boolean[] asc, ReportProcessor rp, PageFormat pf) throws Exception
ReportEngineshowPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog getPreviewDialog(Component c, String title, TableModel m, URL template, URL base, ReportProcessor r) throws Exception
ReportEnginegetPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog getPreviewDialog(Component c, String title, TableModel m, URL template, URL base) throws Exception
ReportEnginegetPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog getPreviewDialog(Component c, String title, TableModel m, URL template, URL base, String[] order, boolean[] asc) throws Exception
ReportEnginegetPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog getPreviewDialog(Component c, String title, TableModel m, URL template, URL base, String[] order, boolean[] asc, ReportProcessor r) throws Exception
ReportEnginegetPreviewDialog in interface ReportEngineExceptionpublic PreviewDialog getPreviewDialog(Component c, String title, TableModel m, URL template, URL base, String[] order, boolean[] asc, ReportProcessor r, PageFormat pf) throws Exception
ReportEnginegetPreviewDialog in interface ReportEngineExceptionpublic String getMonthText(int month)
public String getQuarterText(int quarter)
public String getXMLTemplate() throws IOException
getXMLTemplate in interface ReportEngineIOExceptionpublic Hashtable getColumnWidth()
getColumnWidth in interface ReportEnginepublic void setComponentLocale(Locale l)
setComponentLocale in interface Internationalizationpublic void setResourceBundle(ResourceBundle resourceBundle)
InternationalizationsetResourceBundle in interface InternationalizationresourceBundle - the new language bundle.public Vector getTextsToTranslate()
InternationalizationgetTextsToTranslate in interface InternationalizationCopyright © 2016 Imatia Innovation S.L.. All rights reserved.