Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
[Beginer]Javascript and datasets
peuplier
Hello,
I have a tab with static values, and I wish to retrieve data from several dataset, as I've seen, one of the possibilies offered by BIRT is to use dynamic text and data inside the report. -Iam yet a beginner-.
For this goal, I need obviously to make javascript functions, combine with dataset. How can I do ? the goal is retrieving a column value from a dataset.
Each column value is in fact an sql request, agregation, calculus in my oracle database.
Is it possible to do this with javascript ?
Thx for any help.
Find more posts tagged with
Comments
mwilliams
Hi peuplier,
I'm not sure I'm understanding fully what you mean. Can you explain a little more?
peuplier
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>Hi peuplier,<br />
<br />
I'm not sure I'm understanding fully what you mean. Can you explain a little more?</p></blockquote>
<br />
The goal is to use several datasets. I thought to dynamic texts, but the dynamic text need javascript functions. In javascript functions I wanted to fetch, retrieve fields, or simply handle datasets.<br />
Is it possible ?<br />
<br />
Regards
Davolio
Let me know if this helps,
Ff you click on your dataset and click the scripts tab you'll see several functions:
Before open() when you open the dataset
OnFetch() when you fetch each row
Before close () after the fetch but before the close
SOOOO if you want data from a dataset do something like this
Of course if you want columnnames you are going to be selecting from a system table, but regardless....
in BeforeOpen()
this.queryText = "select colname from table1 "
Then on your OnFetch method you can do something like this:
var x = row["colname"] ;
reportContext.setPersistentGlobalVariable("myColName",x)
Then anywhere in the report after the dataset call you can do this to get that column name
var x = reportContext.getPersistentGlobalVariable("myColName");
This a quick overview but I hope it helps you somewhat.
Regards,
Dave
davdoo
Do you know, how can you do that in Java application with birt API?