Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Hiding Subreport based on Field Value? Post Reply Post New Topic
Author Message
ahamed
Newbie
Newbie


Joined: 21 Sep 2011
Online Status: Offline
Posts: 1
Quote ahamed Replybullet Topic: Hiding Subreport based on Field Value?
    Posted: 21 Sep 2011 at 9:47pm
HI,
 
I Have a field name flag(Number) in the main report.
I have two subreport next to each other in a single detail section. Based on the field value, if it is 0 the left side subreport should be visible or else it should be suppressed or invisible if it is 1. Kindly guide me writing the formula and in which section should i write it.
 
I have wrote the formula by clicking the left subreport--> Format Subreport--> next to suppress button clicked the formula button--> wrote the below formula
 
if{?flag}=0 then true;
 
but the above formula is not working,kindly help me..
 
Thnks...
IP IP Logged
Elisha83
Groupie
Groupie


Joined: 19 Feb 2008
Location: Malaysia
Online Status: Offline
Posts: 62
Quote Elisha83 Replybullet Posted: 22 Sep 2011 at 1:30am
Hi,
 
Just trying to give u some suggestion. Not sure will work or not but u can try.
 
Steps:
1) Share your main report field value into left report.
2) Then drag the share formula into your left report header and try preview the left report and see whether the shared value is correct.
3) If yes, use that shared formula and do your suppress condition.
3Lish@
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 22 Sep 2011 at 3:30am
just a note, your suppress formula is backwards, it will suppress the report if the flag = 0.
 
true =>> suppress the section
 
a simpler way, as the 'if' isn't needed is
 
{?flag} = 1
 
will suppress the object when the flag = 1.
 
HTH
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.016 seconds.