Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: supress section based on date condition Post Reply Post New Topic
Author Message
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Topic: supress section based on date condition
     Posted: 01 Mar 2014 at 5:54am
Hello
 
I want to supress a section if the assessment date is less than 03/01/2014
 
I currently have the formula below in the section expert section but it doesnt seem to be doing the trick.
 
(({ment.assess_date})< date(2014,03,01))
 
 
Help
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Mar 2014 at 3:44am
looks fine ... what section is this suppression on?
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Mar 2014 at 5:30am
and it is in the Suppression(x-1) formula for the group you want to suppress?

again, it looks fine...the other thing to check would be that the field that you are comparing against is the same as being grouped on ( I would display the group in the group header for debugging purposes, just to be sure)
IP IP Logged
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Posted: 03 Mar 2014 at 6:58am

I am trying to supress the entire report based on the date logic. I also have a subreport that has the reverse logic. So if the ment.assess_date is less than 03/01/2014 then i want to supress the entire report and only show the subreport however if the date is grater than 03/01/2014 i want to supress the subreport and show the main report only.

I added the formula to each section in the supress formula section.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Mar 2014 at 7:06am
does your data set have more than 1 row of data in it?
If so, does the "ment.assess_date' field change from row to row or does the value remain consistent in the entire data set?
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Mar 2014 at 7:46am
good point.

ok, jut so that I have a clearer picture, essentially you have 2 reports and only 1 should show based on the date, and the date is a database so there are probably multiple dates.

Do the multiple dates occur in the group, if so are the 'reports' supposed to display correctly? If there is only 1 date per group, life probably isn't too bad.

as a note, if you put the same logic in all sections, then the subreport will be suppressed as well, since the section logic would govern if the subreport is 'run' / displayed.


IP IP Logged
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Posted: 05 Mar 2014 at 5:42am
very strange...this morning my fomula is working properly
 
Thank you for all your help
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