Defining Detailed information (table)

If you want in the excel template to create a table that will return records from a collection, follow these steps:

  1. Create the table header.
  2. In the first table row, below the table header, invoke the desired fields from your collection, using the following syntax:
  3. %EntityName.EntityFieldOfTypeEntityList.ReferencedEntityField(scalar field)

    In DRUID version 5.0 and higher you can map both parent and child properties of the same collection on the same level in the first row of the table. To do so, in a column enter the desired field from your collection using the syntax provided above and in the subsequent columns map the desired low level (child) scalar fields using the following syntax:

    %EntityName.EntityFieldOfTypeEntityList.ReferencedEntityFieldofTypeEntity.ScalarField - for scalar field in a collection or

    %EntityName.EntityFieldOfTypeEntityList.ReferencedEntityFieldofTypeEntityList.ScalarField - for scalar field in a collection within another collection.

    Note:  To generate a nicely ordered excel table, only use cascaded collection (collection in collection); using two collections on the same row in a document template will generate a table that is hard to read.
    Hint:  You can use arguments to further customize the worksheet.

    Example: Generate a report with the list of persons and their street (taken from the person's address)

    • We have an entity called [[Report]] that a field Persons of type Entity List referencing the [[Person]] entity.
    • The [[Person]] entity contains two fields as follows:
      • Name - a scalar field (string)
      • Address - a field of type Entity which has a scalar field, Street.

    In the first table row, below the table header, we invoke the desired Name and Street fields from our collection as described in the figure below.

    Hint:  The generated document will contain as many rows as records are in the collection (in this case in the [[Persons]] collection).
  4. Use formulas as best suits your needs.

This is an example of how a generated document might look like in pdf format:

Arguments

You can specify the following arguments to customize the worksheet.

merge

This argument merges the cells in the column for each object set while filling in data from nested collections.

Syntax

%EntityName.EntityField;merge

%EntityName.EntityFieldOfTypeEntityList.ReferencedEntityFieldofTypeEntityList;merge

Hint:  When getting data from a cascaded collection, to ensure that you get a nice output we recommend you not to use merge on the last level scalar fields from the collection (in the last column of your table) unless you really want to merge that data.

Example

The figure below provides an input template example.

The figure below shows the generated document using the above Excel template example.

repeat

This argument repeats the value for the corresponding records in the column while filling in data from nested collections.

Syntax

%EntityName.EntityFieldOfTypeEntityList.ReferencedEntityFieldofTypeEntityList;repeat

Example

The figure below provides an input template example.

The figure below shows the generated document using the above Excel template example.

collapsegroup

This argument groups the cells in the column for each object set and collapses the data from nested collections.

Syntax

%EntityName.EntityFieldOfTypeEntityList.ReferencedEntityFieldofTypeEntityList;collapsegroup

Example

The figure below provides an input template example.

The figure below shows the generated document using the above Excel template example.

expandgroup

This argument groups the cells in the column for each object set and expands the data from nested collections.

Syntax

%EntityName.EntityFieldOfTypeEntityList.ReferencedEntityFieldofTypeEntityList;expandgroup

Example

The figure below provides an input template example.

The figure below shows the generated document using the above Excel template example.