report & global variables

tomM21tomM21 Member Posts: 13
hi, im struggling with a report:
in the OnPreReport Section i do a lot of calculations which i need for the rest of the report. i pass some of the result into global variables, but as soon as i try tio access their value within the individual pages, eg: OnAfterGetRecord, they are blank / null.
how can i get this?
thx tom

Comments

  • BeliasBelias Member Posts: 2,998
    remember that onaftergetrecord triggers before onpresection of body section(for the same dataitem), so if you evaluate something in onpresection, don't expect to find that value before ;)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • tomM21tomM21 Member Posts: 13
    order of execution:
    1)OnPreReport
    2)OnPreDataItem (1.st DataItem)
    3)OnAfterGetRecord

    > so my qyestion is: if i set a global variable in 1), why is it not available in 2&3?

    thx tom
  • BeliasBelias Member Posts: 2,998
    sorry, my brain interpreted this
    OnPreReport Section
    with "OnPreSection" :mrgreen: #-o

    anyway, did you already tried to debug the code?it should help you a lot. Also, have you developed this report from the beginning or are you modifying somone else's one? (maybe he has done some tricky things you don't know e.g.: properties, skips and breaks and so on...)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • MBergerMBerger Member Posts: 413
    tomM21 wrote:
    order of execution:
    1)OnPreReport
    2)OnPreDataItem (1.st DataItem)
    3)OnAfterGetRecord

    > so my qyestion is: if i set a global variable in 1), why is it not available in 2&3?

    thx tom
    It should be available....are you sure you don't have a global AND local ( local for the OnPreReport ) variable with the same name ?
  • tomM21tomM21 Member Posts: 13
    ok works now. i had a CREATETOTALS for that variable in a subdataitem, somehow it screw it up.

    thx
    tom
Sign In or Register to comment.