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)
Get values from database into a public variable and then into script
sotirisioannou
<p>Hello,</p><p> </p><p>On my report I am using a data set to get some columns from my database to be shown on screen. Everything looks good on this part.</p><p> </p><p>However what I am trying to accomplish is to be able to have access to the data from the script part.</p><p> </p><p>Essentially I'd like to have a global variable in a script which will be accessible from all the scripts on my report. This variable will be an array of objects and each object will have values from two of the columns of my database.</p><p> </p><p>How should I proceed to achieve this?</p>
Find more posts tagged with
Comments
GLO_FR
<p>Hi,</p><p> </p><p>you can set the variable/array in the beforeFactory event of the report.</p><pre class="_prettyXprint">myArray=[];</pre><p>On the onFetch event of your dataset, just populate your array with the dataset value</p><pre class="_prettyXprint">myArray[myArray.length]=row["column name"];</pre><p>afterwad you will be able to use it everywhere in your report</p>
sotirisioannou
<p>Thanks that's good to know.</p>