Blank report in Crystal when Left Join returns no data

That fixed it up! Thank you!

--- In vantage@yahoogroups.com, "lvuhome" <lvuhome@...> wrote:
>
> in the crystal, make sure all link from Jobxxx tables to orderxxx tables to customer table are ALL LEFT OUTER JOIN.
>
> --- In vantage@yahoogroups.com, "ruggers92" <sljones@> wrote:
> >
> > Hello -
> >
> > I've modified the Job Traveler report to include the customer name and
> > PO Number. Works like a champ as long as the job has a PO. When it
> > doesn't, the report is blank.
>
Hello -

I've modified the Job Traveler report to include the customer name and
PO Number. Works like a champ as long as the job has a PO. When it
doesn't, the report is blank.

Modifications:
* Duplicate report data definition for JobTrav
* Add table JobProd, include fields Company, JobNum, OrderNum
- add relationship - Parent Table = JobHead, Key = JobNum, Child
Table = JobProd
* Add table OrderHed, include fields Company, OrderNum, PONum
- add relationship - Parent Table = JobProd, Key = OrderJob, Child
Table = OrderHed, JoinType = true

The JoinType was set to true for the OrderHed relationship to handle the
condition where there is no OrderNum for the job - this ensures that I
still get the rest of the data back.

XML files generate just fine for all conditions so far. However, when
there is no PO, the join on the OrderHed table doesn't happen, so there
is no <OrderHed> table in the XML file - as expected. Crystal is not
playing friendly with this. I created a formula for this value:

if IsNull({OrderHed.PONum}) then
''
else
{OrderHed.PONum}

This causes a blank report. As does the following:

if IsNull({OrderHed.PONum}) then
''
else
''

So it seems that simply having a reference to OrderHed (the table that
is NOT in the XML file), causes the report to choke. Even setting the
Null Treatment to Default Value For Nulls doesn't work.

I tried to abstract it a layer deeper - a PO won't exist if the OrderNum
comes thru as a 0:

if {JobProd.OrderNum} < 1 then
'a'
else
(
if IsNull({OrderHed.PONum}) then
'b'
else
'c'
)

Still chokes. Actually, the 'a' is displayed on the report... so it
seems that Crystal tries to evaluate the entire formula (no short
circuiting).

My last idea - put references to OrderHed in another formula:

if {JobProd.OrderNum} < 1 then
'a'
else
{@NullPONum}

Bombs. So I'm fresh out of ideas... Anyone else?

Steve Jones
A&A Machine & Fabrication, LLC
La Marque, TX
sljones@...
409-938-4274



[Non-text portions of this message have been removed]
in the crystal, make sure all link from Jobxxx tables to orderxxx tables to customer table are ALL LEFT OUTER JOIN.

--- In vantage@yahoogroups.com, "ruggers92" <sljones@...> wrote:
>
> Hello -
>
> I've modified the Job Traveler report to include the customer name and
> PO Number. Works like a champ as long as the job has a PO. When it
> doesn't, the report is blank.
>
> Modifications:
> * Duplicate report data definition for JobTrav
> * Add table JobProd, include fields Company, JobNum, OrderNum
> - add relationship - Parent Table = JobHead, Key = JobNum, Child
> Table = JobProd
> * Add table OrderHed, include fields Company, OrderNum, PONum
> - add relationship - Parent Table = JobProd, Key = OrderJob, Child
> Table = OrderHed, JoinType = true
>
> The JoinType was set to true for the OrderHed relationship to handle the
> condition where there is no OrderNum for the job - this ensures that I
> still get the rest of the data back.
>
> XML files generate just fine for all conditions so far. However, when
> there is no PO, the join on the OrderHed table doesn't happen, so there
> is no <OrderHed> table in the XML file - as expected. Crystal is not
> playing friendly with this. I created a formula for this value:
>
> if IsNull({OrderHed.PONum}) then
> ''
> else
> {OrderHed.PONum}
>
> This causes a blank report. As does the following:
>
> if IsNull({OrderHed.PONum}) then
> ''
> else
> ''
>
> So it seems that simply having a reference to OrderHed (the table that
> is NOT in the XML file), causes the report to choke. Even setting the
> Null Treatment to Default Value For Nulls doesn't work.
>
> I tried to abstract it a layer deeper - a PO won't exist if the OrderNum
> comes thru as a 0:
>
> if {JobProd.OrderNum} < 1 then
> 'a'
> else
> (
> if IsNull({OrderHed.PONum}) then
> 'b'
> else
> 'c'
> )
>
> Still chokes. Actually, the 'a' is displayed on the report... so it
> seems that Crystal tries to evaluate the entire formula (no short
> circuiting).
>
> My last idea - put references to OrderHed in another formula:
>
> if {JobProd.OrderNum} < 1 then
> 'a'
> else
> {@NullPONum}
>
> Bombs. So I'm fresh out of ideas... Anyone else?
>
> Steve Jones
> A&A Machine & Fabrication, LLC
> La Marque, TX
> sljones@...
> 409-938-4274
>
>
>
> [Non-text portions of this message have been removed]
>