problem with fields in function
hi, i am working with delphi xe4 and fast reports 4.14
I need some help with my report.
i use a custom function called bereken_rij
wheni call this function from the report in a variable
like this [bereken_rij('test")] it works, i get test in the variable
when i call this function from the report in a variabe
like this
[bereken_rij(<frxagenda."rapport">)]
i get an acces violation error.
what am i doing wrong.
I need some help with my report.
i use a custom function called bereken_rij
wheni call this function from the report in a variable
like this [bereken_rij('test")] it works, i get test in the variable
when i call this function from the report in a variabe
like this
[bereken_rij(<frxagenda."rapport">)]
i get an acces violation error.
what am i doing wrong.
Comments
if i put the field frxagenda."rapport"> direct in the report it shows fine.
what i am trying to do is depending on the value of that field to show a text
the field was integer but that wo'nt work so i tried a string
the function is
function bereken_rij(rij:string):string;
begin
case strtoint(rij) of
1: result:='08:30- 09:00';
2: result:='09:00 - 10:30';
3: result:='10:30-12:00';
end;
the varible in the report is tijd.
if i call the function from the report without the field entry - [bereken_rij('1') ]i get as result 08:30- 09:00
if ik put in the field [bereken_rij(<frxagenda."rapport">)] i get the tijd:acces violation error at adress 0092BE45 in module exenaam read of adres 00000000
thanks for your help i am just an idiot.
i had forgotten in the sql query the field rapport, it was in the however in the frxdataset alias so it appears in the report
also it was in de predifined sql quey so in the report it works.
In runtime the rapport field coudnt be found therefore the error.