Grid sorting

I have a grid configured as a pivot table, showing only the summary. I would like to sort by a field, but not display it, but can figure out how to do it.

column names and values in my database :
item_sort item_name
1ca Current Asset
2lta Long term Asset
3cl Current Liability
4ltl Long Term Liability

On my report I want the order to be:
Current Asset
Long Term Asset
Current Liability
Long Term Liability

But the report sorts it alphabetically
Current Asset
Current Liability
Long Term Asset
Long Term Liability

Is there a way to decode “item_sort” at run time so that my report shows “item name” but in the right order?
Thanks.

Can you do it from the SQL? It is irritating to me as well. I understand that if I put it in the ORDER BY clause, I cannot dynamically change it on the grid. But, since you only activate the summary on your grid, it may work.

If you want to add the sorting to the SQL, I think you need to change the generated field, Total(Sum) as field (calculated field) in the SQL clause, but this become very strict that we cannot change the order once defined, for example from ASC to DESC.

Just an idea but I have not try this, is that possible that we show the field so that it is available on the SORTING menu but using event [SIZE=12px]onScriptInit [/SIZE]we hide using sc_field_show({the_field}, off)? Or can someone explain whether the sc_select_order macro can be used in this case? The documentation is very light and no clear example on this.

I am still not sure how to do sorting of the calculated field or foreign key (int) field.