Print Page | Close Window

Group Cloaking

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3082
Printed Date: 03 May 2025 at 8:21pm


Topic: Group Cloaking
Posted By: moleary
Subject: Group Cloaking
Date Posted: 30 Apr 2008 at 12:51pm
I have two groups in my report that are based off formulas. I also have a parameter that shows details or not.  Is there a way to not group on group one if they choose not to see details? I know I can supress it but it still breaks it out by date, but in my summary (no detail) I just want to see the group by (?GROUP).... Below are my group formulas
 
Does this make sense?
 
 
group1-
IF {?DATE}='E' THEN
{gm_rpt_AdjustmentWriteOff;1.ENTRYDATE}
ELSE
IF {?DATE}='P' THEN
{gm_rpt_AdjustmentWriteOff;1.PAYDATE}
 
group2
IF {?GROUP} = 'R' THEN
    {gm_rpt_AdjustmentWriteOff;1.RDOC}
ELSE
IF {?GROUP}  = 'P' THEN
    {gm_rpt_AdjustmentWriteOff;1.PROV}
ELSE
if {?GROUP} = 'F' THEN
    {gm_rpt_AdjustmentWriteOff;1.FACILITY}
ELSE
IF {?GROUP} = 'N' THEN
'ALL'



Replies:
Posted By: Seva
Date Posted: 01 May 2008 at 2:25pm
Built Subreport, same as Main Report, but without Group 1 and details, and put it to the Main Report footer.
Now you will suppress or Subreport, or all Sections of Main Report,
except of Main Report footer.
 
Thanks,
Seva


Posted By: hilfy
Date Posted: 02 May 2008 at 2:19pm

Sometimes subreports aren't the best answer - they take extra processing and create a second connection to the database.

You could modify your groups.  I would break this down into 4 formulas, something like this:
DateGroup
IF {?DATE}='E' THEN
  toText({gm_rpt_AdjustmentWriteOff;1.ENTRYDATE}, 'yyyyMMdd')
ELSE
IF {?DATE}='P' THEN
  toText({gm_rpt_AdjustmentWriteOff;1.PAYDATE}, 'yyyyMMdd')
WriteoffGroup
IF {?GROUP} = 'R' THEN
    {gm_rpt_AdjustmentWriteOff;1.RDOC}
ELSE
IF {?GROUP}  = 'P' THEN
    {gm_rpt_AdjustmentWriteOff;1.PROV}
ELSE
if {?GROUP} = 'F' THEN
    {gm_rpt_AdjustmentWriteOff;1.FACILITY}
ELSE
IF {?GROUP} = 'N' THEN
'ALL'
Group1
If {?DETAILS} = 'Y' then
  mailto:%7b@DateGroup - {@DateGroup }
else
  mailto:%7b@WriteoffGroup - {@WriteoffGroup }
Group2
If {?DETAILS} = 'Y' then
  mailto:%7b@WriteoffGroup - {@WriteoffGroup }
else
  ' '
You can use any string in the else of Group2.
 
Because formulas always have to have the same data type in the result, you have to convert your date fields from your current Group1 to a string.  If your dates will span multiple years, you have to use the 'yyyyMMdd' format, otherwise they won't sort correctly.  For example, with 'MM/dd/yyyy' format you would have the following order:
 
01/01/2007
02/01/2005
12/01/2006
 
but in 'yyyyMMdd' format you get:
 
20050201
20061201
20070101
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window