Print Page | Close Window

Conditional hiding of column header

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=20902
Printed Date: 01 May 2024 at 6:50pm


Topic: Conditional hiding of column header
Posted By: subash141
Subject: Conditional hiding of column header
Date Posted: 22 Jul 2014 at 9:21pm
HI,
 
My requirement is conditional hiding of column headers based on column values. If a particular column doesn't display any values then that column header should be hide.
 
For this i did a work around like below ...
 
first i created a variable as
numbervar x:=0; -- placed this in page header.
 
created a second variable like ...
whileprintingrecords;
x:=x+(if isnull(column) then 0 else 1)  -- placed this in detail section
 
created third variable sum like ...
whileprintingrecords;
numbervar x;  -- placed this in page footer.
This sum will display no of values displayed in that column per page in the page footer.
 
hiding condition is
 
if ( isnull(column) and {sum}=0) then true else false.
this condition is working for some pages not working for some pages.
 
 
Please help me in this issue.



Replies:
Posted By: subash141
Date Posted: 24 Jul 2014 at 12:31am
Hi,
 
I got the solution for this. By placing the column headers in group header and writing the hiding condition i achieved.
 
I have taken distinct count of values and placed that value also in group header.
Based on this value i have written hiding condition.
 
"distinct count(column)=0 then hide."
 
Now it is working fine.
 
Thanks,
Subash



Print Page | Close Window