Menu

XLSX CORE

Provides the basic tags of XLSX templates.

Tags of this library may only be used in XLSX document content.

forEach

The forEach tag iterates through a specified Collection's contents, producing new copies of the content within the tag's defined area.

For every item in the Collection, a copy of the content within the tag's area is produced. The item is placed into ths tag's local variable context and the EL expressions within the copied content are evaluated. The evaluated content is then placed onto the worksheet. If it is the first item, the content is placed within the tag's defined area. The content for every following item is then placed below the previous content.

If the collection has more than one item, the produced content expands downwards past the tagged defined name's area. If there is content below the area, it will be shifted downwards as much as needed. Should there be any content that would be shifted beyond row 1048576 - the last possible row on an Excel worksheet - that content will be lost.

This tag produces a local variable context for the expressions within its area.

Attributes

value


Required
Value type
EL-evaluated
Yes
Collection, Map, Data Item
Yes
This attribute defines the container whose contents the tag will iterate through. While this container is primarily expected to be a Collection, two other types of types are also accepted.

The three types are handled in the following ways:
  • If the value is a Collection, forEach iterates through the items in it in their proper order.  
  • If the value is a Map, forEach iterates through its entries. The item of every round is therefore a Map entry that allows both the key and the value to accessed.
  • If the value is a Data Item, forEach performs just one loop round, with the Data Item being the item of the round.  
var

Required
Value type
EL-evaluated
Yes String
No
The value of this attribute defines the name of the local context variable that holds the current item of the loop.
logic

Required
Value type
EL-evaluated
No String
Yes
The resolved value of this attribute should be an ID of a Loop controller that will be used during this forEach's evaluation.
if

Makes the content covered by the tag's area conditional. If the condition is not fulfilled, the content disappears.

Attributes

test

Required
Value type
EL-evaluated
Yes Boolean Yes
Defines the condition that determines whether the content stays or not. Should the resolved value be false, the content disappears. 
collapse

Required
Value type
EL-evaluated
No Boolean Yes
Defines how other content reacts to the potential disappearance of the content within this tag's area. If the resolved value is true and test resolves to false, any content below this tag's area is moved up by as many rows as this tag's area covered. If the resolved value is false or left undefined instead, the contents below will not be moved.

Comments

0 comments