During transformation, is may be desirable occasionally to change or set the value of a bean variable. One use case would be to create a short cut for a verbose expression that is commonly used, e.g. shortcut for x.foo.foo2.foo3.foo4.foo5. While one can define such a variable in the beans map prior to transformation, the "set" tag allows one to do so during transformation.
Use the optional "display" attribute to display the contents of the cell, if any.
In this example, a relatively complicated expression employees[3].catchPhrase is assigned to a new variable bugsCatchPhrase, a new value is assigned to x, and a new numeric value is assigned to y. Subsequently, each variable is displayed. The tag in C2 is cut off; the full value of the cell is <jt:set var="bugsCatchPhrase" value="${employees[3].catchPhrase}" display="${bugsCatchPhrase}"/>.
After transformation, the new variables have their values. Notice how ${1} was used to assign a numeric value to a variable; content outside of ${} is interpreted as text.
The new values of variables are available in cells that are processed after the cell in which the "set" tag was evaluated.