Print Page | Close Window

Hiding Subreport based on Field Value?

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=14440
Printed Date: 27 Apr 2024 at 12:09pm


Topic: Hiding Subreport based on Field Value?
Posted By: ahamed
Subject: Hiding Subreport based on Field Value?
Date 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...



Replies:
Posted By: Elisha83
Date 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@


Posted By: lockwelle
Date 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



Print Page | Close Window