Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: suppress blank section of data field and the label Post Reply Post New Topic
Page  of 2 Next >>
Author Message
johnwsun
Senior Member
Senior Member


Joined: 28 May 2008
Location: Australia
Online Status: Offline
Posts: 179
Quote johnwsun Replybullet Topic: suppress blank section of data field and the label
    Posted: 20 Jan 2009 at 6:30pm
Hi
 
At the runtime I wish to suppress blank section of data field together with its label/description when there is no data in data field, e.g.
 
source:      XXXXX (data field)
 
the source (label) and the data field are in one of the Detail sections. I want to suppress source too when there is nothing in [data field] and without a blankline. Normally I can suppress the [data field] via section expert when there is no data. However, with label in that section I cannot achieve this. Any advices would be appreicated.
 
I'm using CR XI
 


Edited by johnwsun - 20 Jan 2009 at 6:31pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Jan 2009 at 9:19pm
In the section expert detail section conditionally suppress the line with a formula:
isnull(field)=true
IP IP Logged
johnwsun
Senior Member
Senior Member


Joined: 28 May 2008
Location: Australia
Online Status: Offline
Posts: 179
Quote johnwsun Replybullet Posted: 20 Jan 2009 at 9:40pm
After putting that formula to conditinally suppress the line, the report still display text/label:
 
source:
 
PLease provide further help, thanks very much
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 21 Jan 2009 at 6:33am

text/labels don't have the ability to be suppressed...so I make a formula.  In this case the formula would be:

"Source: " + {datafield}
 
Then when you 'format the field' for the formula, on the common tab there is a line to suppress, click the x-2 button and enter the code to suppress ie isnull({datafield})
 
Hope this helps
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Jan 2009 at 6:56am
Lockwelle,
Shouldn't the entire row regardless of any other item types that are on it be suppressed if a the condition is met via the suppression formula? I am understanding John's situation to be that both the text item and the data item reside on the same detail row, hence they can both be suppressed by suppressing the detail row under the single condition. Am i missing somethng there?
John, do you now if your "blank" values are nulls or empty strings? If they have empty strings you can also try to add in your suppression of the detail row:
 
isnull({table.field})=true or {table.field}=""


Edited by DBlank - 21 Jan 2009 at 6:56am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 21 Jan 2009 at 9:04am
DBlank,
OOPS, absolutely, you are suppressing the entire row so the label is gone as well.  Since it is still visible, would imply that the data is not NULL, but something else (probably blank).
 
From the description, I thought that the field had been suppressed and that the label remained...
 
Gotta read more carefully.
IP IP Logged
johnwsun
Senior Member
Senior Member


Joined: 28 May 2008
Location: Australia
Online Status: Offline
Posts: 179
Quote johnwsun Replybullet Posted: 21 Jan 2009 at 3:03pm
thank you all,
The text/label "Source" is actually hard coded in the section using Insert -> Text object:
Source:
I cannot use "Source: " + {datafield} in a formula as Lockwelle advised as that if there is data displaying they won't line up with the lines above and below.
All the text/labels are hard-coded in their sections, and the data fields are left aligned.
Is there a better way?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Jan 2009 at 3:10pm

Did you try to suppress the detail section (not the datafield itself) in the section expert using the formula

isnull({table.field}) or {table.field}=""
 
If that does not work can you tell us what type of datafield is that is coming up "blank"
IP IP Logged
johnwsun
Senior Member
Senior Member


Joined: 28 May 2008
Location: Australia
Online Status: Offline
Posts: 179
Quote johnwsun Replybullet Posted: 21 Jan 2009 at 3:18pm
Hi DGlank,
isnull({table.field}) or {table.field}=""  doesn't work.
my data field is just string field.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Jan 2009 at 4:12pm
Ok I am at a loss as to why that is not suppressing it. I don't want to insult you but you are replacing the {table.field} with the actual data source correct?
I just can't think why that won't suppess the line...
Lockwell, any ideas here? Maybe trimming the field?

Edited by DBlank - 21 Jan 2009 at 4:14pm
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.