# KReporter 4.2 treeview issue

**URL:** <https://community.spicecrm.io/t/kreporter-4-2-treeview-issue/210>\
**Category:** Uncategorized\
**Created:** [November 16, 2017, 1:28pm UTC](https://community.spicecrm.io/t/kreporter-4-2-treeview-issue/210 "2017-11-16T13:28:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonnygribben](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jonnygribben](https://community.spicecrm.io/u/jonnygribben)\
**Post date:** [November 16, 2017, 1:28pm UTC](https://community.spicecrm.io/t/kreporter-4-2-treeview-issue/210/1 "2017-11-16T13:28:48Z")

</div>

Hi,

We have recently updated to KReporter v4.2 and we’re seeing an issue with a treeview report. When I run the report no data is displayed and there is a SQL error in the sugarcrm.log. When I turn the query analyser on a different query is outputted than in the sugarcrm.log, this query works when I run in manually. This report worked as expected before the upgrade and other treeview reports are working after the upgrade. Any ideas what the issue might be?

Thanks,  
Jonny

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [November 16, 2017, 1:42pm UTC](https://community.spicecrm.io/t/kreporter-4-2-treeview-issue/210/2 "2017-11-16T13:42:07Z")

</div>

Jonny,

I need to see the query. Could you send me the error + query thrown in sugarcrm.log?

Valérie

![](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/778803c82bc45f619060086a1b4363bc8c8b09d3.jpg)

![](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/cb6477d7486e12f28258ffdc8751d356bee647a8.jpg)

---

<div class="post-metadata">

**Author:** ![jonnygribben](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jonnygribben](https://community.spicecrm.io/u/jonnygribben)\
**Post date:** [November 16, 2017, 1:52pm UTC](https://community.spicecrm.io/t/kreporter-4-2-treeview-issue/210/3 "2017-11-16T13:52:18Z")

</div>

Hi Valérie,

Emailed the details to you there.

Thanks,  
Jonny

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [November 16, 2017, 2:55pm UTC](https://community.spicecrm.io/t/kreporter-4-2-treeview-issue/210/4 "2017-11-16T14:55:58Z")

</div>

The issue is how we define queries with grouping clause.  
MySQL error 1056: Can’t group on 'k781089439a8c80b6b7363468e5e6’  
We used to have a condition for mssql and oracle (use MIN() on grouped field) until KReporter 4.1.  
In KReporter 4.2 we removed it since newest mysql works the same way. Maybe too new for now.  
For next release we will probably introduce an additional sugar\_config variable and restore the condition statement.
