Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 28 Jul 2014 at 5:03am
CR is working as designed, an aggregate is for a group, not a page.
you can accomplish what you are after using shared variables and a string...at least that is what I would do.
in the page header, I would reset the string to "" and the counter to 0 (I would also do this in a group header). Then in the detail section, I would have a formula that would check if the value is in the string, if not, increment the counter and add the value to the string. If it is in the string, do nothing.
now in the page footer, display the count.
hopefully your groups are forcing a new page before otherwise the count will be odd, and I will leave that case logic to you.
Joined: 28 Mar 2011
Online Status: Offline
Posts: 9
Posted: 28 Jul 2014 at 6:02am
Hi,
Thanks for your reply.
But my requirement is i need to hide the column if it doesn't hold any values.
Currently i can able write the hiding condition based on the distinct values of a column. If that column don't have any value its column header should hide.
To achieve this i am taking distinct count of column values. But it is working only if group have one page of data. It is failing when group is having more than one page.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 30 Jul 2014 at 5:03am
sorry, what you want to do, is not really possible in CR.
Why?
CR only reads 1 row at a time, and the aggregates are for the entire group. so you cannot suppress the column on page 2 and display if for page 3 for the same group.
a work around would be to use a subreport (which will slow the report down) or to use a stored proc, figure out a number protocol so that you can determine for any given group on a page if it will have to display the column (may not be doable, unless each group starts on a new page)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum