KoolReport's Forum

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

Missing one record #393

Open Sourabh Jain opened this topic on on Jul 25, 2018 - 5 comments

Sourabh Jain commented on Jul 25, 2018

For eg - When I run query from mysql or mongo the count will return 10. And when same query will run through koolreports the count is 9. Always (mysql count -1) Any reason?

KoolReport commented on Jul 25, 2018

May I know how do you make the count, is it in the table footer or somewhere else. Could you please share you code?

Sourabh Jain commented on Jul 30, 2018

$this->src('ops')

    ->query(array("collection"=>"user_data"))
    ->pipe($this->dataStore('user_data'));

This will return only single record whereas this table has 2 records.

$user_data = $this->dataStore("user_data")->data(); If i count $user_data, the count will be one.

David Winterburn commented on Jul 30, 2018

Hi,

Please open the file MongoDataSource.php and replace the following line:

for($i=1; $i<$rowNum; $i++)

with:

for($i=0; $i<$rowNum; $i++)

Let us know if it fixes your problem. Thanks!

Sourabh Jain commented on Jul 30, 2018

Thanks. But this is the same case with mysql.

$this->src('rp')
        ->query("SELECT annotation_type FROM tbl_user_annotation_activity")
        ->pipe(new Filter(array(
            array("annotation_type","!=","bookmark")
        )))
        ->pipe(new Group(array(
            "count"=>"annotation_id"
        )))
        ->pipe($this->dataStore('annotation'));
KoolReport commented on Jul 31, 2018

It could be the Filter, because one of the row could have annotation_type "bookmark" so KoolReport filters it out. Also in the Group process, I have not seen the "by" settings and the "annotation_id" seems not available ( from the query). It could cause unexpected 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
None yet

None