DALDEI
Posts: 12
|
Posted: 10/27/2009, 6:06 AM |
|
For some reason the forum wouldnt let me reply to an existing post so I'm posting new for future reference.
If you add a GROUP BY expression to GRID it breaks them completely, not only are the navigation broken, but it shows "No Records" at the bottom (in CCS 4.3 atleast) even when there are rows.
I used the code posted and augmented it so that it works without having to know your SQL.
In Java, MySQL this works for me
Add a Before Execute Select Custom Code and add this
e.getCommand().setCountSql(
"SELECT COUNT(*) FROM (" + e.getCommand().getSql() + ") as t"
);
((Grid)e.getModel()).setCountNeeded(true);
---
Not sure at all why this isnt done by CCS itself .. .I have opened a defect and will see if they reply.
_________________
David Lee
CTO Nexstra, Inc
dlee@nexstra.com |
|
|
shev
Posts: 2
|
Posted: 11/09/2009, 3:14 AM |
|
|
|
|
shev
Posts: 2
|
Posted: 11/09/2009, 3:14 AM |
|
You tried to configure it in VQB ?
|
|
|
DALDEI
Posts: 12
|
Posted: 11/09/2009, 6:36 AM |
|
Yes, Visual Query Builder fails miserably if I have a sum and group-by clause.
It produces good SQL for the query but NO sql for the record counting which completely screws up the grid form.
A reply by CC Support also concludes this is "a known issue".
_________________
David Lee
CTO Nexstra, Inc
dlee@nexstra.com |
|
|
|