Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: How to display row count per page in grouping Post Reply Post New Topic
Author Message
subash141
Newbie
Newbie


Joined: 28 Mar 2011
Online Status: Offline
Posts: 9
Quote subash141 Replybullet Topic: How to display row count per page in grouping
    Posted: 27 Jul 2014 at 8:47pm
Hi All,
 
I have a requirement to display distinct count of column values per page in grouping.
 
In my report i have 2 groupings. When i try to get distinct count of values it is giving value per group.
If group is having 2 pages of data how display distinct count per page in that grouping.
 
Please provide a solution.
 
Thanks,
Subash
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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.

HTH
IP IP Logged
subash141
Newbie
Newbie


Joined: 28 Mar 2011
Online Status: Offline
Posts: 9
Quote subash141 Replybullet 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.

Please help me in this.

Thanks,
Subash
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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)

at least those are my ideas
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.031 seconds.