For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > January 2006 > links in tables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author links in tables
Pinner

2006-01-23, 7:07 pm

Hi,
I'm working with 4 tables (1,2,3 and 4. table 1 is the main one) in
crystal report 9.

Table 1 (Impmrp) : item
Table 2 (listp) : pricelist for the first type of items
table 3 (z_kni_moulage): pricelist for the second type of items
table 4 (inv) : pricelist for the third type of items

Item in table 1 is linked to the respective item field in each table.

here's the formula I'm using : (basic style .. not crystal)

If {Impmrp.Item} = {Listp.Item} then
formula = {Listp.Prix}
elseif {Impmrp.Item} = {Z_KNI_Moulage.Item} then
formula = {Z_KNI_Moulage.Coutant_MO}
else
formula = {Inv.Prix_Est}
end if

Basically, crystal is supposed to take the price inside the table (2,3
and 4) in which both items are the same.

The problem is the formula is not returning any results !!
Is there anyone who could help me?
Is the problem in my formula? In the links?

thanks to all
Pinner

Iain Sharp

2006-01-23, 7:07 pm

On 23 Jan 2006 06:34:14 -0800, "Pinner" <spinard@uapinc.com> wrote:

>Hi,
>I'm working with 4 tables (1,2,3 and 4. table 1 is the main one) in
>crystal report 9.
>
>Table 1 (Impmrp) : item
>Table 2 (listp) : pricelist for the first type of items
>table 3 (z_kni_moulage): pricelist for the second type of items
>table 4 (inv) : pricelist for the third type of items
>
>Item in table 1 is linked to the respective item field in each table.
>
>here's the formula I'm using : (basic style .. not crystal)
>
>If {Impmrp.Item} = {Listp.Item} then
> formula = {Listp.Prix}
>elseif {Impmrp.Item} = {Z_KNI_Moulage.Item} then
> formula = {Z_KNI_Moulage.Coutant_MO}
>else
> formula = {Inv.Prix_Est}
>end if
>
>Basically, crystal is supposed to take the price inside the table (2,3
>and 4) in which both items are the same.
>
>The problem is the formula is not returning any results !!
>Is there anyone who could help me?
>Is the problem in my formula? In the links?
>
>thanks to all
>Pinner


The links should be outer joins. (left outer with the item table on
the left usually).

Secondly, the formula needs changing as follows.

If ( isnotnull( {Listp.Item}) and {Impmrp.Item} = {Listp.Item}) then
formula = {Listp.Prix}
elseif (isnotnull( {Z_KNI_Moulage.Item}) and {Impmrp.Item} =
{Z_KNI_Moulage.Item}) then
formula = {Z_KNI_Moulage.Coutant_MO}
else
formula = {Inv.Prix_Est}
end if

Crystal fails if the data value is null (unless it's specifically
tested for)

Iain
Pinner

2006-01-23, 7:07 pm

the outer joint were already in place. It was the notnull fonction
that was missing!!
thanks, it's now working!!

Iain Sharp

2006-01-23, 7:07 pm

On 23 Jan 2006 06:55:26 -0800, "Pinner" <spinard@uapinc.com> wrote:

>the outer joint were already in place. It was the notnull fonction
>that was missing!!
>thanks, it's now working!!


Welcome.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com