Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Get Current Group Post Reply Post New Topic
Author Message
CMiner
Newbie
Newbie


Joined: 12 Feb 2010
Location: United States
Online Status: Offline
Posts: 4
Quote CMiner Replybullet Topic: Get Current Group
    Posted: 13 May 2010 at 12:11pm
Using Crystal Reports Developer 11.0.0.1282

I'm looking for a function or formula so that a formula field can tell what group or section it is in.

For example, if I have a report that is grouped by Country -> Region -> City

When I drill down, I have the next level's data, then the previous levels total, i.e.:

(DrillDownGroupLevel 1)
Country1
Region1   Total   FieldX
Region2   Total   FieldX
Region3   Total   FieldX
Country1   CountryTotals

then drill down on Region1, and get

(DrillDownGroupLevel 2)
Region1
City1   Value
City2   Value
City3   Value
Region1   Total   FieldX


What I want is function or formula to put in FieldX so that FieldX knows that it is in the Region group/section.  DrillDownGroupLevel doesn't work because FieldX stays in the Region group section whether I'm in DrillDownGroupLevel 1 or 2.

Something that will return "Group Footer 4" or "Group Header 2" or something would be perfect, I just can't find it.

Note: The built in "GroupNumber" function doesn't work for my needs, as it just counts up the # of groups that have been encountered
IP IP Logged
CMiner
Newbie
Newbie


Joined: 12 Feb 2010
Location: United States
Online Status: Offline
Posts: 4
Quote CMiner Replybullet Posted: 17 May 2010 at 6:06am
Is there really no way to do this?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 May 2010 at 6:44am
I do not really understand your question.
When drilling down each row of data inside that group has all the data from each group level in every row. You can just drop that field onto a group header and it will show it.
If you only want it to display at certain times then you can conditionally suppress these field using the drilldowngrouplevel function.
Am I missing something else that you are trying to do here?


Edited by DBlank - 17 May 2010 at 6:45am
IP IP Logged
MikeZ
Newbie
Newbie


Joined: 05 Nov 2011
Online Status: Offline
Posts: 4
Quote MikeZ Replybullet Posted: 05 Nov 2011 at 1:50pm
DrillDownGroupLevel does not work when you have no groups hidden.
 
There is a groupnumber function which displays how many groups are available in your report. So if you have only 1 group in your report and it is repeated 100 times this function will always show 100
 
How ever if you have 6 groups in your reports, it can be helpfull for some reason to have a formula, which is places in detailed section and in group footer section, which is conditiond to calculate depending to be in details section, or group 1, or 2... Etcetera ;)
 
At least, that is the problem I am having ...
So maybe anyone knows?
 
Regards MikeZ
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Nov 2011 at 5:06am
drilldowngrouplevel "works" even if you do are not using group suppression in the section expert. It simply is a value associated with the number of levels that you have drilled into the report.
IP IP Logged
MikeZ
Newbie
Newbie


Joined: 05 Nov 2011
Online Status: Offline
Posts: 4
Quote MikeZ Replybullet Posted: 10 Nov 2011 at 3:13am
If you have no hidden groups to drill down, so all group headers are visible, the result for this formula in my report (CR 2011) is always "0"
 
I would like to find a way to show the result 1 if the formula is in Group Header (or feeter) 1, 3 if the formula is in Header or feeter Group 3 etc
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Nov 2011 at 3:24am

it is zero until you drill into a group (even though it is not suppressed you can still drill into it). Think of drilldowngrouplevel more as report layers than groups.

 
for your group levels you can simply place a text box in each of your group headers and label them 1, 2, 3 respectively.
Although I think you are tyring to accomplish something more here. Perhaps if you lay out you data and desired end result someone can give you a direction to accomplish that end result.
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.046 seconds.