Reputation: 43
I'm using Crystal Reports in Visual Studio 2003 and i want to automatically change details section height (resize it) if one of the fields is empty.
My report looks like this:
'-----------------------------------'
[Product] [Weight] [Quantity]
[Note]
'-----------------------------------'
So if [Note] is empty, i want to auto fit details section, so that it looks like:
'-----------------------------------'
[Product] [Weight] [Quantity]
'-----------------------------------'
Because now i am getting extra free space, which i don't want and it looks like:
'-----------------------------------'
[Product] [Weight] [Quantity]
'-----------------------------------'
Upvotes: 4
Views: 9578
Reputation: 605
I would create a new sub-section; so you have two details sections. Details-A and Details-B.
Place [Product] [Weight] [Quantity] in Details-A and place [Note] in Details-B below.
Then in the section expert, select Details-B and click the formula button. Use a formula to suppress the section when [Note] is not populated; something like:
if isnull([Note]) or [Note]='' then true else false
This will suppress the note section if its blank; thus keeping your details section nicely sized.
Upvotes: 3