-
Notifications
You must be signed in to change notification settings - Fork 74
Structure
Eugene Degtyarjov edited this page Nov 8, 2013
·
19 revisions
Let's consider the following class diagram which describes the structure of any Yarg report.
Report contains:
- Name (String).
- Code (String).
- The link to root band. Bands are organized in tree-like structure, so each band can contain set of other bands, and also link to parent band.
- The list of templates. Template can be a file of necessary format (xlsx, docx, etc...) or it can be custom, which means that you will need to write rendering class or script.
- The list of field formats, which describe custom formats for certain fields.
- The list of parameters. These are parameters used for data loading and document rendering.
Band contains:
- Name (String). Name should only contain letters, numbers or "_" symbol.
- The list of children bands.
- The list of queries which describe how to load data for certain band.
- The link to parent band (Root band doesn't have parent).
Query contains:
- Name (String).
- Script (String). Script contains sql or groovy or a custom load script.
- The loader type (sql, groovy, etc) (String).
com.haulmont.yarg.loaders.factory.ReportLoaderFactory
defines supported loaders.
Template contains:
- Code (String). Code is used to create report using certain template.
- The document name (String).
- The document content which is basically binary template file data.
- The output type (String).
com.haulmont.yarg.formatters.factory.ReportFormatterFactory
defines supported formats. - Template has output name pattern (String). It should be used if your resulting report name should depend on band data or supplied parameters (e.g. "incidents summary 2013-01-01 to 2013-02-01.xlsx").
- Template can be custom. If it's custom - customReport class should be returned by getCustomReport(). This class should implement
com.haulmont.yarg.formatters.CustomReport
.
- Format has name (String). The name should consist of band name and output field name, which needs to be formatted. BandName.fieldName
- Format has format description (String). It can be a standard java format string (as
##,##
ordd-MM-yyyy
) or custom format string.
###Parameter
- Parameter has name. Name should only contain letters, numbers or "_" symbol.
- Parameter has alias. Alias can be used in all formatters and loaders.
- Parameter can be declared required.
- Parameter declares Java class. The parameter value must be the instance of this class.
During data loading Yarg transforms report bands tree to the result bands tree. Please see the following picture which describes this process.