Skip to content

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.

uml

Report

Report contains:

  1. Name (String).
  2. Code (String).
  3. 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.
  4. 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.
  5. The list of field formats, which describe custom formats for certain fields.
  6. The list of parameters. These are parameters used for data loading and document rendering.

Band

Band contains:

  1. Name (String). Name should only contain letters, numbers or "_" symbol.
  2. The list of children bands.
  3. The list of queries which describe how to load data for certain band.
  4. The link to parent band (Root band doesn't have parent).

Query

Query contains:

  1. Name (String).
  2. Script (String). Script contains sql or groovy or a custom load script.
  3. The loader type (sql, groovy, etc) (String). com.haulmont.yarg.loaders.factory.ReportLoaderFactory defines supported loaders.

Template

Template contains:

  1. Code (String). Code is used to create report using certain template.
  2. The document name (String).
  3. The document content which is basically binary template file data.
  4. The output type (String). com.haulmont.yarg.formatters.factory.ReportFormatterFactory defines supported formats.
  5. 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").
  6. Template can be custom. If it's custom - customReport class should be returned by getCustomReport(). This class should implement com.haulmont.yarg.formatters.CustomReport.

Field format

  1. Format has name (String). The name should consist of band name and output field name, which needs to be formatted. BandName.fieldName
  2. Format has format description (String). It can be a standard java format string (as ##,## or dd-MM-yyyy) or custom format string.

###Parameter

  1. Parameter has name. Name should only contain letters, numbers or "_" symbol.
  2. Parameter has alias. Alias can be used in all formatters and loaders.
  3. Parameter can be declared required.
  4. Parameter declares Java class. The parameter value must be the instance of this class.

Resulting data

During data loading Yarg transforms report bands tree to the result bands tree. Please see the following picture which describes this process.

transform

Clone this wiki locally