Sorting on a Global variable

Is it possible to sort a body section of a report depending on global variable ??? Thanks .

Hi, a body-section always refers to a dataitem in your report. And data items only can be sorted by existing keys. So you could have a secondary key in your table and you fill the key-fields before using the dataitem. Or you could use some workaround with table 2000000026. This body would have nothing to do with the sorting, but only with printing. The sorting you could perform in an array, that you fill before using it in the body-sections of table 2000000026. Richard

If you want to do sorting by an existing key, you can use the global variable in the predataitem trigger to select the key. For example (pseudocode): Case GlobalVar of Value1: DataItem.SETCURRENTKEY(Key1); Value2: DataItem.SETCURRENTKEY(Key2); John