Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Grouping Headers Post Reply Post New Topic
Author Message
Jenny00
Newbie
Newbie


Joined: 27 Sep 2011
Online Status: Offline
Posts: 6
Quote Jenny00 Replybullet Topic: Grouping Headers
     Posted: 27 Sep 2011 at 8:50am
I have a complicated report that I inherited that includes about 10 subreports. The reports pulls information based on a date range. However the information is brought in also by county ID.
My issue:
I need for the report to show the counties for which the information is coming from and not just the totals for the various data. My parameters include a county ID and date range, but if you enter zero in the county ID, it pulls in all the information from all the counties that meet the date range parameters.

How do I have it not rely on the county ID parameter; but instead show the county for which each particular piece of data comes from? I'd like the report to show the county name and then all the information pertaining to that county, then show the next county name and it's information, and so on. All this will be based on a date range.

Again, this report was given to me to make this change and I'm stuck. Please let me know if I need to provide more information.
Thnak you.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Sep 2011 at 12:18pm
is the country field in the subreport(s) or the main report?
 
if it is in the main report, I would think that you could just build a group on the country code.  The part about the 0 is for filtering your data, not displaying it.
 
If the value is in a subreport...I don't know how i would attack the problem.  Somehow, you would want to get the country, but you would need it from every subreport which is non-deterministic (at least to the main report), so I don't believe it could be done.
 
This is just the first thought, as I don't know the report or the data.
 
 
IP IP Logged
Jenny00
Newbie
Newbie


Joined: 27 Sep 2011
Online Status: Offline
Posts: 6
Quote Jenny00 Replybullet Posted: 27 Sep 2011 at 12:51pm

It appears that the county ID parameter is on several subreports and the main report, and I can't delete it on any of them.

Could I add a group header to each report? Not sure what that would do.

I'll try and post a copy of the report.
Thanks.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 30 Sep 2011 at 3:42am
Upon futher reflection,
 
what I would try is add a group by country in the main report, then to make the grouping work, I would add a parameter to each of the subreports that would filter them by country, and I would link the new parameter in the subreport to the main report.
 
It may not be ideal (the report will probably run slower as it is now hitting the database more), but given that you inherited the report, without major rewrite it seems like a viable option.
 
HTH
IP IP Logged
Jenny00
Newbie
Newbie


Joined: 27 Sep 2011
Online Status: Offline
Posts: 6
Quote Jenny00 Replybullet Posted: 30 Sep 2011 at 3:48am
Ok, I'll give that a try it. Actually, I'll try anyghing, my deadline is fastly approaching.

Thanks.
IP IP Logged
Jenny00
Newbie
Newbie


Joined: 27 Sep 2011
Online Status: Offline
Posts: 6
Quote Jenny00 Replybullet Posted: 30 Sep 2011 at 6:30am


Looking at this from another angle: this formula below is in the header. When I enter zero for the county ID parameter, I get nothing for the header. All I see the totals for the data being called. But if I enter a countyId in the ?countyID parameter, then I see the name of the county (which is what the formala is to do).

However my issue is this: I need to show the county ID for any and every county ID that is being called from the database that is bringing forth the data in the report. And the data needs to be grouped by that countyId.

Can I edit this formula below so that if I enter null or a countyID in the parameter, and I get the list of countyID's from which the total it being created from grouped.

Did that make sense??? Thanks

_____________________________________
stringvar result := '';

if {?@CountyID} <> 0 then
    result := 'County: ' + {County.County_Name};

if {?@CourtID} <> 0 and {?@CountyID} <> 0 then
    result := result + '   ';

if {?@CourtID} <> 0 then
    result := result + 'Court: ' + {Court.Name};

result
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 30 Sep 2011 at 8:13am
if you are looking to use this formula as a grouping formula, I would remove all the references to   {?@CountyID}, since what you want to as a grouping formula is something that returns a value.
 
HTH
IP IP Logged
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