Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Suppressing a Section Post Reply Post New Topic
Page  of 2 Next >>
Author Message
riker
Newbie
Newbie
Avatar

Joined: 07 Dec 2010
Online Status: Offline
Posts: 16
Quote riker Replybullet Topic: Suppressing a Section
    Posted: 07 Dec 2010 at 8:22am

I'm hoping to get some help from the experts on here.

 
I'm very new to Crystal Reports and might be trying to accomplish something that just isn't possible.

 

Using Crystal XI I'm trying to write a report that will give us a list of parts that we haven't used in a pre-determined amount of time. I've collected all the data I believe is necessary, and just need to figure out how to exclude the parts we have used.

 

I thought I would be able to do this by suppressing sections based on the most recent dates for transactions. The problem I'm running into is it seems to only suppress the section based on 1 date not 2 like I need it to.

 

I created a Running Total Field based on the max date for each type of transaction. Then in the Section Expert I entered a formula like this.

 

{#MaxDateSTK-MTL} > CurrentDate -730

 

And that seems to work good. But when I change it to...

 

{#MaxDateSTK-MTL} > CurrentDate -730

     or

{#MaxDatePUR-STK} > CurrentDate -730

 

It doesn't work for both dates.

 
Maybe it can't be done the way I'm trying to do it.
 
Any and all help on this would be greatly appreciated!
IP IP Logged
c16271
Groupie
Groupie
Avatar

Joined: 24 Aug 2010
Location: United States
Online Status: Offline
Posts: 48
Quote c16271 Replybullet Posted: 07 Dec 2010 at 9:01am
Are both of the summary fields for two different parts?

{#MaxDateSTK-MTL} and {#MaxDatePUR-STK}

If so, couldn't you group those records together?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Dec 2010 at 9:02am
can explain your report design a little more or post some sample data and how you want it to look in the end.
...I am surprised you are having luck using the RT to suppress unless it is suppressing footers.
IP IP Logged
riker
Newbie
Newbie
Avatar

Joined: 07 Dec 2010
Online Status: Offline
Posts: 16
Quote riker Replybullet Posted: 07 Dec 2010 at 9:09am
Thanks for the reply c16271!
 
They are both for the same part, but different transaction types.
 
STK-MTL is the trans for using the part on a job.
PUR-STK is the trans for purchases.
 
When I group them I miss parts that have recently been purchased but not used.
IP IP Logged
riker
Newbie
Newbie
Avatar

Joined: 07 Dec 2010
Online Status: Offline
Posts: 16
Quote riker Replybullet Posted: 07 Dec 2010 at 9:47am
Originally posted by DBlank

can explain your report design a little more or post some sample data and how you want it to look in the end.
...I am surprised you are having luck using the RT to suppress unless it is suppressing footers.
 
I'll do best to clarify...
 
IMO only 3 fields matter when it comes to figuring out the last time we used something.
 
Part Number
Transaction Type
Transaction Date
 
I grouped to data by Part Number then Tran Type and finally Date. I then created the Running Total Fields based on each transaction types max date.
 
The section I'm trying to suppress is the Group Header and the only other data in the header is costing info.
 
I hope this helps. I'm still thinking I'm going about it wrong...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Dec 2010 at 9:59am
So you want a list of anything (part number) not used in the last 2 years.
What is your sample data under 1 part number that is the transaction type that defines what youa re looking at (basically your RTs per group).
IP IP Logged
riker
Newbie
Newbie
Avatar

Joined: 07 Dec 2010
Online Status: Offline
Posts: 16
Quote riker Replybullet Posted: 07 Dec 2010 at 10:23am
Exactly what I'm looking to do.
 
partnum
000530003
STK-MTL
8/13/2010
PUR-INS
4/25/2008
ADJ-QTY
10/25/2008
 
Here is a sample of the data I get in my groups, I then Hide GH2 and GH3 leaving just GH1 that includes my costing data.
 
The RTs are based on the Max date for each tran type. I put them in GF1, which is then hidden.  The RTs are told to Evaluate and Reset on the change of Group#2.
 
Hope this is what you were asking for.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Dec 2010 at 10:29am
If I understand you correctly:
Group on PartNUM only
create a formula field to flag these called @flag
if table.transtype in ['STK-MTL','PUR-STK'] then table.datefield
insert a SUmmary (sigma sign) as the MAXIMUM of @Flag at the Partnum group
go into the select expert and expand it.
flip it to group selection and enter your criteria here:
MAXIMUM({@flag},{table.partnum}) <dateadd('yyyy',-2,currentdate)


Edited by DBlank - 07 Dec 2010 at 10:33am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Dec 2010 at 10:31am
make sure to flip the group select criteria option to use 'Default values for nulls' in case you have any part numbers with no details rows

Edited by DBlank - 07 Dec 2010 at 10:34am
IP IP Logged
riker
Newbie
Newbie
Avatar

Joined: 07 Dec 2010
Online Status: Offline
Posts: 16
Quote riker Replybullet Posted: 08 Dec 2010 at 3:20am
Worked great! Thank you very much DBlank!
 
I'm hoping to get some clarification on a couple things. Because like I said I'm new to Crystal and report writing in general.
 
In the line...
 MAXIMUM({@flag},{table.partnum}) <dateadd('yyyy',-2,currentdate)
You show ('yyyy',-2,currentdate) but I would like to be able to use how many months since the last use instead of years.
I tried..
('mm',-24,currentdate) but that didn't work.
I'd also like to have the user prompted for how many months they want to go back. So I added a Parameter Field for number of months back. When I put the PF in the formula should it look like this?
MAXIMUM({@flag},{table.partnum}) <dateadd('mm',{?fieldname},currentdate)?
 
I hope that makes since :)
IP IP Logged
Page  of 2 Next >>
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.