Print Page | Close Window

Previous Function / section supression

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=8716
Printed Date: 03 May 2024 at 2:50pm


Topic: Previous Function / section supression
Posted By: Theorren
Subject: Previous Function / section supression
Date Posted: 22 Dec 2009 at 11:00am
I am trying to supress the details section if a field is repeated.  I found the previous funtion and I am trying to use it to test the values. It appears to be working, except that it is testing for all values and not for just the group.
 
 eg:
 
group by Client ID
 detail :  (randomfield1)
 
here is the code I am using for the suppresion
 
isNull (randomfield1)
or
(Previous (randomfield1)= (randomfield1)
    and {Client.ID} = {Client.ID})
 
I am trying to test that the field is not empty (if it is, then supress the details) and that the field is not duplicated ( per client ID) . If it is duplicated, I want to supress it.
 
The issue is that if ClientID 1 . randomfield1 = ClientID2. randomfield1 then ClientID2. randomfield1  is suppressed ( which I don't want).
 
Any suggestions or tips?


-------------
- Ted



Replies:
Posted By: DBlank
Date Posted: 22 Dec 2009 at 12:10pm
isNull (randomfield1)
or
(Previous (randomfield1)= (randomfield1)
    and Previous({Client.ID}) = {Client.ID})


Posted By: Theorren
Date Posted: 22 Dec 2009 at 12:27pm
Worked perfect! Thanks!

-------------
- Ted


Posted By: mohsinhasan87
Date Posted: 22 Jul 2012 at 7:54pm
Hi,

I am also in a same situation and I used your formula but it says ) is missing.
This is what I have written


isNull (dt_VU_GETMSG_SERVICE.FSHORTCODE)
or
(Previous ({dt_VU_GETMSG_SERVICE.FMONTHLY_RENTAL})= {dt_VU_GETMSG_SERVICE.FMONTHLY_RENTAL}
    and Previous({dt_VU_GETMSG_SERVICE.FSHORTCODE}) = {dt_VU_GETMSG_SERVICE.FSHORTCODE})

Please help me where I am wrong.
Thank you


Posted By: DBlank
Date Posted: 26 Jul 2012 at 3:56am
it looks fine other other than you are missing the brackets on the first field.
isNull ({dt_VU_GETMSG_SERVICE.FSHORTCODE})


Posted By: MikeTex
Date Posted: 21 Nov 2012 at 11:07pm
I'm having a similar problem, i'm using a Sub-Report and it does something like:
61         "61Name"         123         987
62         "62Name"         345         678
         Total                    468       1665
 
61         "61Name"         123         987
62         "62Name"         345         678
         Total                    468       1665
 
If i run the Sub-Report as a Report it returns only one group of records.
Tried to use the "Previous" funtion with no results.
Thanks in advance.
 
Mike


-------------
Mike Teixeira



Print Page | Close Window