Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Print null records Post Reply Post New Topic
Page  of 3 Next >>
Author Message
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Topic: Print null records
    Posted: 03 Dec 2014 at 6:26am
This seems like an easy thing to do but I can't figure out a solution for the life of me.

Running v10 Pro

3 tables included with 6 fields total, want to exclude a specific contract type from being included in the output. If I add the record selection formula to exclude the type I want removed from the report it does exclude them but since some accounts do not have a contract associated those records are also not printing which is a problem.

If I exclude the table that contains the contract type it obviously prints out all the records including the contract type I need to exclude.

Help please...
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 03 Dec 2014 at 6:57am
Sounds like  a table linking issue.  I suspect you need an outer join with the table that has a the contract type.
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 03 Dec 2014 at 7:04am
I first suspected that as well but each has a left outer join type and per our CRM vendor that is the recommended setting for their fields
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Dec 2014 at 7:12am

you mean in your select you are using

tableA.field <> 'contract type 1'
 
you can change the select formula option to 'use default values for nulls'
 
If you are using any other select criteria it may start dropping other records out and you would be better off using a command or stored proc as your data source and move the condition from the WHERE to the join for that table
Example:
 
select A.Field1, A.Field2,B.field1,B.field2,C.field1,C.field2
from
Table1 as A
LEFT JOIN table2 as B oN A.field=B.field and B.Type <>'xxx'
LEFT JOIN table3 as C ON A.field=C.field


Edited by DBlank - 03 Dec 2014 at 7:25am
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 03 Dec 2014 at 7:40am
I'm using option A - tableA.field <> 'contract type 1'

How do I change the select formula option 'use default values for nulls'?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Dec 2014 at 8:30am

in the formula workshop window there is a pick list with 2 options on how to handle NULL values



Edited by DBlank - 03 Dec 2014 at 8:30am
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 03 Dec 2014 at 8:47am
Sorry but I'm not familiar with a "pick list" and its options. Can you please direct me as to what should I be looking for in the workshop?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Dec 2014 at 9:01am

click on select expert

click on show formula

click on formula editor

One of the option in the tool bars has a pick list(drop down) options. Mine appears next to the crystal or basic syntax pick list opption.
The tool bar can be moved and detached though.
I have heard others not having it but I assume it is just hidden
 
You can also use this to specifically indicate how to handle a NULL in the select syntax:
NOT(ISNULL(field)) or Field <> 'value'
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 03 Dec 2014 at 9:45am
As far as I can tell all of the toolbars are included in the workshop and the only pick lists I see are greyed out - one looks like a piece of paper and the other has the text "crystal syntax". I added the formula below and refreshed the data and it still not showing blank records.

NOT (IsNull({tblContracts.ContractType}))

Sigh....
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Dec 2014 at 10:12am
can you show some sample data rows with all 6 fields and what you are trying to do with said sample?
IP IP Logged
Page  of 3 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.016 seconds.