Portlet Factory, Version 6.1.2
Adding Columns to a Table
You can use the Data Column modifier builder to add columns to a table in your model.
- In the Data Column modifier, enter names for the new columns in the Add Columns input. Separate the names with a comma. This will add the columns to the table in the Data Column modifier and allow you to configure the column. However, these columns are empty until you supply data. You will need another data source separate from the one used by Data Page. This datasource can be another variable, another SQL call, or some other source.
- You will also need to select another builder for displaying the additional data. This can be any page control.
- If the variable used by the Data Page builder contains 20 rows of data, create another variable that also contains 20 rows, where each row has new column names.
- Add your Page Control builder. This may be a text input, a text builder or any other control that you want to use to display your data.
- Configure the control to use the new page location that was created when you added the extra columns using the Data Column Modifier.
- Set the source data for the control to be the second variable and use the loop counter as an index for your variable. For example if there is a variable named Shoes that looks like this:
<top> <shoe> <size>5</size> <color>red</color> </shoe> <shoe> <size>6</size> <color>green</color> </shoe> <shoe> <size>7</size> <color>blue</color> </shoe> </top>- Use a reference such as ${Variables/Shoes/top/shoe[myRowLoopVar]/size}, where "myRow" is the name of the rows from the Data Page variable and "myRowLoopVar" is the name of the counter generated for the Data Page variable.
When a control is added for each row by the repeat logic in Data Page, the matching row in the data will be accessed.
Parent topic: Data Column Modifier builder
Library | Support |