problem with fields in function

edited October 2013 in FastReport 4.0
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.

Comments

  • gpigpi
    edited 12:30PM
    Show bereken_rij code and check <frxagenda."rapport"> value
  • edited October 2013
    gpi wrote: »
    Show bereken_rij code and check <frxagenda."rapport"> value
    thanks for you quik reply gpi

    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
  • gpigpi
    edited 12:30PM
    wrote:
    if i put the field frxagenda."rapport"> direct in the report it shows fine.
    Can you attach your fp3 file with <frxagenda."rapport"> values?
  • edited October 2013
    problem resolved
    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.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.