Print Page | Close Window

Hiding the fields on Reports

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6151
Printed Date: 19 Apr 2024 at 11:53pm


Topic: Hiding the fields on Reports
Posted By: ashisahb
Subject: Hiding the fields on Reports
Date Posted: 22 Apr 2009 at 2:07am
Hi Guys ,
 
Can we hide some of the fields in the reports based on some conditions ??
like say ..if the dats is 22/04/2009 , a particular column should be suppressed.
 
 


-------------
Regards,
Ashish



Replies:
Posted By: hilfy
Date Posted: 22 Apr 2009 at 10:55am
Yes. 
 
To hide specific objects, right-click on the object and select "Format <x>..." where <x> is Field, Formula, etc. depending on the type of object.  Go to the Common tab and click on the button to the right of "Suppress".  Enter a formula that evaluates to True or False.  When it is true, the object will be suppressed.  For your example above, the formula would read something like:
 
CurrentDate = Date(2009, 04, 22)
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: ashisahb
Date Posted: 23 Apr 2009 at 11:45pm
That worked Clap
 
Mr Dell .....thanks a ton.


-------------
Regards,
Ashish


Posted By: hilfy
Date Posted: 24 Apr 2009 at 6:54am
Actually, it's Ms Dell.  Big%20smile  Since my name is not gender-specific, that's a pretty common mistake.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: ashisahb
Date Posted: 29 Apr 2009 at 2:04am
ohhh...am sorry @ that...
 
one more question...
 
Can we dynamiccaly move the column position. Lets say we have 5 columns and we hide 2 and 3 rd one , then 4 and 5 th should move in place of 2 and 3 rd......is it possible????


-------------
Regards,
Ashish


Posted By: hilfy
Date Posted: 29 Apr 2009 at 8:41am
No problem - it happens all the time!
 
There is no way to have Crystal dynamically move them if they're set up as just fields.  However, you could create formulas for the fields that you want to hide and all of the fields to the right of them.  The formula would be in the format:
 
If <hide condition> then <non-hide field> else <hide field>
 
You then use the formulas in place of the fields and use the suppress on the last field to the right.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: ashisahb
Date Posted: 30 Apr 2009 at 3:13am
thanks for reply.
 
My client is very specific to the order of fields so cant puch the suppressed fields to the end.
 
we can apply some formulas on the size and position , isnt it?
 
i tried applying something for X Position Adjustment like
if(condition) then 4.32
 
where 4.32 is the new X position , but didnt worked , I am not very sure how to apply formulas here...
 
 


-------------
Regards,
Ashish


Posted By: lockwelle
Date Posted: 30 Apr 2009 at 6:30am

Adjusting the position will work, but there are some conditions.  First the move is in some unit, so if you want to move 1 inch it is 1*1440.  Second, and this is the really hard one, the position in the formula is the RELATIVE distance from the location of the field in design time.

So if you have a field at 1.0, and in the formula you say you want it at 2.0 *1440 (which you would think would locate it at 2.0), your field will end up at 3.0 (1+2).  If you need it to move backwards (to the left) it would be a negative move.
 
I have written only 1 report that is completely dynamic, the order and headers being completely userdefined at run time as a proof of concept.  Only the headers were ever defined and moved, it isn't pretty and maintenance could be a pain, but it work.  Basically, what I had was all of the fields were at the same spot on the report, and then depending on string that was passed into the report, the report would shift each column correctly (accumulating how far it had moved and adding space between each column) to its new location.  All columns not needed were suppressed.
 
The biggest help was creating a custom function to keep track and do all of the moving of the fields.
 
I don't have the report any more, but with this, you might be able play around a create a solution that works for you.


Posted By: lockwelle
Date Posted: 30 Apr 2009 at 6:33am
it just dawned on me, if you wanted, you could perform the calculations in the app and just pass a formatted string to the report.  The report could then parse the string and move the columns...
 
well its a thought.  hope it points you towards a solution.


Posted By: ashisahb
Date Posted: 04 May 2009 at 5:06am
Hi http://www.crystalreportsbook.com/forum/member_profile.asp?PF=3327&FID=8 - lockwelle  ,
 
I have tried above solution of applying formula , by putting some vale of around 3000 , but didnt worked....may be some issue of binding.
 
So finally dropped the idea and created new template....
 
One more question :
 
Can we terminate the Report Generation dynamically with the help of template, like say...for some X value , process should be aborted and no report should be generated. 


-------------
Regards,
Ashish


Posted By: lockwelle
Date Posted: 04 May 2009 at 6:30am
not that I know of


Posted By: Teddy555
Date Posted: 13 Jun 2017 at 5:42am
Good suggestion Ms.Dell , I have a query in regards to the given example. Is it possible to hide (drilldown Enable) a single record rather than an entire section ?

-------------
T.Calderon


Posted By: hilfy
Date Posted: 13 Jun 2017 at 6:27am
Not that I'm aware of.

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window