Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
counters in onCreate
arunkumarb
Hi,
I declared one count variable and initialized with 0 like cnt=0 in onPrepare and now I am incrementing the my count variable in onCreate method. Unfortunately the count variable will be incremented only once for any number of records.
Let me know what is the problem?
Regards,
Arun
Find more posts tagged with
Comments
Hans_vd
Hi Arun,
onPrepare of what item?
onCreate of what item?
What are you using the count variable for? Did you consider using the RUNNINGCOUNT aggregation function?
Regards
Hans
CBR
onPrepare and onCreate are two different things. Depending on the setup they even run in two separate processes which means that you can not access variables created in onPrepare from within onCreate.
Try initializing your variable in beforeFactory event of the report itself. Increment that variable in onCreate of the element you are interested in.
In addition do not use the var statement to declare the variable.
beforeFactory:
cnt = 0;
onCreate:
cnt++