Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: suppress entire column Post Reply Post New Topic
Author Message
valisorin
Newbie
Newbie


Joined: 29 Jul 2010
Location: Romania
Online Status: Offline
Posts: 4
Quote valisorin Replybullet Topic: suppress entire column
     Posted: 29 Jul 2010 at 4:19am
hi,
i have a big problem, i cant suppress entire column without remaining blank column
i have try with format oject -> suppress > X-2 ->
"if  (isnull({GroupsModel.Name})) then
true"
all data are load that
reportDocument.SetDataSource(reportGroupModel);
where reportGroupModel is an IEnumerable<TValue>
where i made the mistake ?

thank you for help
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 Jul 2010 at 6:50am
When you suppress an object, you're just telling Crystal to not show the object - other objects on the report will not move to fill in the space where the suppressed object was.
 
-Dell
IP IP Logged
valisorin
Newbie
Newbie


Joined: 29 Jul 2010
Location: Romania
Online Status: Offline
Posts: 4
Quote valisorin Replybullet Posted: 29 Jul 2010 at 7:27am
ok, thanks for reply
any suggestion to resolve this problem?
can i give 0 width of column ? because i didnt find any formula to set the width to 0
thank you !
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 Jul 2010 at 7:37am
Setting the width to 0 will still not not move the other columns over.  What you're looking for is something like "relative positions", which is not available in Crystal.
 
However, there is a way to simulate this:
 
For the column you want to suppress and for every column to the right of it, create a formula.  The formulas will look something like this:
 
if (isnull({GroupsModel.Name}))  then {table.next field to the right} else {table.field when name has a value}
 
If you have multiple data types in these fields, you'll have to convert them all to strings using the ToText() function or else the formulas won't work.
 
Then, use these formulas on the report instead of the fields that you already have.
 
-Dell
IP IP Logged
valisorin
Newbie
Newbie


Joined: 29 Jul 2010
Location: Romania
Online Status: Offline
Posts: 4
Quote valisorin Replybullet Posted: 04 Aug 2010 at 9:01pm
i resolve the problem
i founded the solution here http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=171
i create a dataset with 3 tables: ColumnValues, ColumnNames, Title with column names: DataColumn1, DataColumn2, DataColumn3 .....
in my reportGroupModel i have bool field Visibility
i populate the ColumnValues and ColumnNames check the field Visibility
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