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)
Page Variables
mwallis
I am new to BIRT (I'm using 2.6.1) and in the onFetch() for my data set I try to set a number of page variables as below.
reportContext.setPageVariable("User_Name", row["EMP_FIRST_NAME"]);
Then in a table, I have a text element that in the onPrepare() I use the following to display the variable.
this.content = reportContext.getPageVariable("User_Name")
I know the getPageVariable works correctly because it displays the default value. It appears the setPageVariable in the onFetch() of the data set is outside the scope of what the table can see. How can I set the variable in the onFetch() and see the value in the element?
Thanks, I appreciate any suggestions.
Melissa
Find more posts tagged with
Comments
mwilliams
I think the problem you're seeing is that the data is not available in the onPrepare, so that's why the default comes through. Have you tried using the onCreate to display the variable? Also something that could keep you from getting the set values of the variables would be if you don't have an element bound to your dataSet in which you are setting the values of the pageVariables. If you don't have an element bound to this dataSet prior to your text box where you're trying to display the variable, the dataSet will not have been run yet and you will only see the default. Hope this helps.