Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppress blank records on report Post Reply Post New Topic
Author Message
Cindy
Newbie
Newbie
Avatar

Joined: 13 Jan 2009
Location: United Kingdom
Online Status: Offline
Posts: 31
Quote Cindy Replybullet Topic: Suppress blank records on report
     Posted: 30 Sep 2009 at 11:20am
Is there a way to suppress blank fields in a report?  I notice you can suppress records while printing but I don't want them show up at all as it creates so much white space.  I suppose I could set in select expert but not sure of the syntex.  The field is blank if there is no data.  And there are 20 fields, these fields are memo fields and not always have data.
 
Thanks in advance!
Cindy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Sep 2009 at 11:26am
this can posibly be an empty string or null
You can filter the rows that have this out in your select expert via:
NOT(isnull({table.field}) or {table.field}="")
 
You can suppress using similar criteria
IP IP Logged
Cindy
Newbie
Newbie
Avatar

Joined: 13 Jan 2009
Location: United Kingdom
Online Status: Offline
Posts: 31
Quote Cindy Replybullet Posted: 30 Sep 2009 at 11:50am

Can I use the same theory if I want to suppress records that have no data in the 20 memo fields?  The records will have data such a case number but I don't care to show on the report unless there is a memo.

 
Thanks again!
Cindy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Sep 2009 at 11:55am
If you mean you have a row of data with a caseno and twenty other memo fields on that row then you can exclude them with a really long statement that checks all of the memos fields on that row of data.
 
Not (
(isnull(memo1) or memo1="")
and
(isnull(memo2) or memo2="")
and
(isnull(memo3) or memo3="")
and
...
(isnull(memo20) or memo20="")
)
 
Is that what you are looking for?


Edited by DBlank - 30 Sep 2009 at 11:57am
IP IP Logged
Cindy
Newbie
Newbie
Avatar

Joined: 13 Jan 2009
Location: United Kingdom
Online Status: Offline
Posts: 31
Quote Cindy Replybullet Posted: 30 Sep 2009 at 12:05pm
I think so as  I am going to try your suggestion.  I'd like to write a SQL statement instead of using the select expert.  I couldn't edit the "Show the SQL query" :-).
Would I use the SQL expressions fields?  I'm good with SQL queries and fairly new to CR.  Can I import an SQL query?
Cindy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Sep 2009 at 12:16pm

What is your data source (SQL tables, Stored Proc, something else?) and how are you getting the data into the report (Command, ODBC,???)...

You would need to filter the data at your source or change your source to use a COmmand where you can write your SQL or use the select expert in crystal. If you are good with SQL crystal will come pretty easy to you.
IP IP Logged
Cindy
Newbie
Newbie
Avatar

Joined: 13 Jan 2009
Location: United Kingdom
Online Status: Offline
Posts: 31
Quote Cindy Replybullet Posted: 30 Sep 2009 at 12:22pm
My source is SQL tables connecting via ODBC.  Thank you...Thank you.... as I didn't think about using the command.  I'm going to try your syntax writing a SQL query with the Command.
 
Thanks again, have a great day!
Cindy
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