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)
help with data selected
sm_arg
Hi!
I have a sql query that return some columns. I want to obtain from one column(ex. row["clients"]) all the rows and iterate over them, doing it in javascript.
I got the row needed, by <VALUE-OF>row["clients"]</VALUE-OF> in client javascript, but my question is: there is a way to iterate over all the rows??
Find more posts tagged with
Comments
sm_arg
Hi! I need your help...
I have a sql query that return some columns. I want to obtain from one column(ex. row["clients"]) all the rows and iterate over them, doing it in javascript.
I got the row needed, by <VALUE-OF>row["clients"]</VALUE-OF> in client javascript, but my question is: there is a way to iterate over all the rows??
thanks a lot!
CBR
There are only two elements that can iterate over all rows of a dataset:
1) The onFetch event of the data set
2) A element that prints out all rows of a dataset
The onFetch is called if the dataset is used in a report, so you need to print it out anyways.
What i would do is to add a table bound to that dataset as first element to your report. The table will initiate that the data is fetched from the dataset. Now i would implement a script or the onCreate event handler for the table detail row. From there you can access a single record and the script is run once for each record.
It is very unlikely that you want to have that table in your final output. You can simply set visibility to hide for this table. Hide means it will generate the table but it will not add it to the output.
What do you want to do? Perhaps there is n easier way to do it.
sm_arg
Ok, it can help yes!
I want to create an html combobox with the values obtained from specific column of the query. For that i need to iterate over the rows obtained and load the combobox.
With that idea, i can create an array(javascript) variable in the report, and load it on the onFetch or onCreate as you say, and in a text element get that variable and iterate over it.
If this works i tell you!
ANNKRUSE
<blockquote class='ipsBlockquote' data-author="'sm_arg'" data-cid="99893" data-time="1335966276" data-date="02 May 2012 - 06:44 AM"><p>
Hi!<br />
<br />
I have a sql query that return some columns. I want to obtain from one column(ex. row["clients"]) all the rows and iterate over them, doing it in javascript.<br />
<br />
I got the row needed, by <VALUE-OF>row["clients"]</VALUE-OF> in client javascript, but my question is: there is a way to iterate over all the rows??<br /></p></blockquote>
<br />
Not sure if this is what you are asking but ...<br />
Select * <br />
From Clients is the way to get all of the fields in a table.