Moving Totals with Columns
Ā
It's possible to have total fields that are moved along with the columns when using the "movable columns" feature of a subfile grid.Ā This is done by adding output fields for your totals, and putting them just under the grid, beneath the appropriate column.Ā Then, you must set the "id" property of the total field to be the same as the "id" for the subfile field with a suffix of "_total" (without quotes).
For example, consider this subfile:
The TotSales and TotRefunds fields are output fields that are not in the subfile, but are placed beneath the columns that they pertain to.Ā Ā To make them move along with the columns you should:
Click on the Grid widget, and change the movable columns property to true.
Click on the ORAMOUNT field, and set the id property to Amount (you can use any name you like here, but you'll need to know what it is in step 4.)
Click on the ORREFUND field, and set the id property to Refund (you can use any name you like here, but you'll need to know what it is in step 5.)
Click on the TotSales field and set the id property to Amount_total.Ā This must be exactly the same (including upper/lower case letters) as the column it corresponds to (Amount, in this example) with _total as a suffix.
Click on the TotRefunds field and set the id property to Refund_total. This must be exactly the same (including upper/lower case letters) as the column it corresponds to (Refund, in this example) with _total as a suffix
.Ā
Now save and recompile your display file. Also add the calculation for TotSales and TotRefunds to the RPG program, if necessary.
Profound UI will look for fields with the _total suffix, and will automatically move them along with their corresponding columns.Ā Fields are moved by temporarily adjusting the "left" property by the same amount as was needed to move the subfile column.