KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Error on sort rows after using grouping #1595

Open widea tecnologia opened this topic on on Aug 24, 2020 - 5 comments

widea tecnologia commented on Aug 24, 2020

Hello, I'm needing some help here.

In my Table widget, I'm trying to sort rows by using Table's widget sort feature after apply group by. But nothing happens.

Table::create(array(
    "dataSoure"=>$this->dataStore("test"),
    "grouping" => array("category")
    "sorting"=>array(
        "orderDate"=>"desc",
    )
));

Can someone help me?

KoolReport commented on Aug 25, 2020

May I know:

  1. Is there error showing?
  2. If you remove sorting, does it work?
  3. Have you check your datasource if you have columns category and orderDate
widea tecnologia commented on Sep 1, 2020
  1. There's no error
  2. It works, but doesn't sort by orderDate
  3. Yes, the datasource has both columns

The widget acts like there's no sorting param

Sorry for the late reply

KoolReport commented on Sep 2, 2020

If you want to sort by date, your date should be in the form "2020-08-20" (-Y-m-d). There is many case the date was formatted to other form like "August 20th, 2020" before being sorted, the date will be sorted by string.

widea tecnologia commented on Sep 5, 2020

I'm also trying to sort by other fields, no one works properly if I apply the grouping. Is not a kind of date format

KoolReport commented on Sep 7, 2020

Is it possible that you can post us:

  1. Sample of data
  2. Your code
  3. Image of unwanted result.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None