Board index » delphi » Report Smith derived fields

Report Smith derived fields

I made a report with a detail group like this:

date        code
01-06-97    2  
03-06-97    3

Now, code 2 stands for 'start' and code 3 for 'end'. I want to put that
on the report. So I made a derived field that is defined by a macro.

The macro is:

if "code"=2 then derivedfield "start"
end if
if "code"=3 then derivedfield "end"
end if

The macro compiles succesfully. However, the derived field appears on
the report saying N/A .

What am I doing wrong?

10^6 thanx
--
R. van Laake   raym...@vezass.nl
Vezass Amsterdam      Oostenburgervoorstraat 134  1018 MR  AMSTERDAM
tel ..31-(0)204202323   fax ..31-(0)204202232   email i...@vezass.nl

 

Re:Report Smith derived fields


Both 'if' statements are failing because you are putting 'Code' in quotes.
You are asking if the string "Code" is equal to 2, which it is not, then
asking if it is equal to 3, which it is not. You need to say Field("Code")
or something like that (it's in the macro help).

--
Mark Bratcher
mbra...@ix.netcom.com

R. van Laake <raym...@vezass.nl> wrote in article
<3398AC62.2...@vezass.nl>...

Quote
> I made a report with a detail group like this:

> date        code
> 01-06-97    2      
> 03-06-97    3

> Now, code 2 stands for 'start' and code 3 for 'end'. I want to put that
> on the report. So I made a derived field that is defined by a macro.

> The macro is:

> if "code"=2 then derivedfield "start"
> end if
> if "code"=3 then derivedfield "end"
> end if

> The macro compiles succesfully. However, the derived field appears on
> the report saying N/A .

> What am I doing wrong?

> 10^6 thanx
> --
> R. van Laake   raym...@vezass.nl
> Vezass Amsterdam      Oostenburgervoorstraat 134  1018 MR  AMSTERDAM
> tel ..31-(0)204202323   fax ..31-(0)204202232   email i...@vezass.nl

Re:Report Smith derived fields


Both 'if' statements are failing because you are putting 'Code' in quotes.
You are asking if the string "Code" is equal to 2, which it is not, then
asking if it is equal to 3, which it is not. You need to say Field("Code")
or something like that (it's in the macro help).

--
Mark Bratcher
mbra...@ix.netcom.com

R. van Laake <raym...@vezass.nl> wrote in article
<3398AC62.2...@vezass.nl>...

Quote
> I made a report with a detail group like this:

> date        code
> 01-06-97    2      
> 03-06-97    3

> Now, code 2 stands for 'start' and code 3 for 'end'. I want to put that
> on the report. So I made a derived field that is defined by a macro.

> The macro is:

> if "code"=2 then derivedfield "start"
> end if
> if "code"=3 then derivedfield "end"
> end if

> The macro compiles succesfully. However, the derived field appears on
> the report saying N/A .

> What am I doing wrong?

> 10^6 thanx
> --
> R. van Laake   raym...@vezass.nl
> Vezass Amsterdam      Oostenburgervoorstraat 134  1018 MR  AMSTERDAM
> tel ..31-(0)204202323   fax ..31-(0)204202232   email i...@vezass.nl

Other Threads