Announcement

Collapse
No announcement yet.

Grid sorting

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.








  • #2
    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.

    Comment


    • #3
      I have the same problem. I want to sort the summary by Total Late In Sum Descending. But all I can do is sort by the value of the rows group alphabetically, or... I don't know how the other one is sorted (see 1st & 2nd pics).

      I set them from the panel in the 3rd picture, but I'm not sure if it works as intended.

      And I'm not sure if adding ORDER BY in SQL will work, since I want to sort it by a generated field, Total (Sum).

      Comment


      • #4
        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 onScriptInit 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.

        Comment

        Working...
        X