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)
Set value to report parameter
nav33n89
Hi,<br />
<br />
I have created a report parameter, named EquipmentName and ID=459...<br />
<br />
Now I want to <strong class='bbc'>write a javascript </strong>to assign value to the report parameter. I dont want to do it with promptbox... I have to code and assign value to report parameter<br />
<br />
<strong class='bbc'>Psedocode : <br />
<br />
var x=10;<br />
document.getElementbyId("459").setValue = x;</strong><br />
<br />
Please help.<br />
<br />
Thanks
Find more posts tagged with
Comments
Angioletto
Hi,
you have to click on tab SCRIPT and you can write script like:
x = 10;
params["ParamName"] = x;
If you have other problem write.
Angelo Coletta
nav33n89
Hi,<br />
<br />
Thanks for the reply...<br />
<br />
while creating dataset I worte query using "?" and then I have mapped the report parameter to the dataset query input parameter...<br />
<br />
Now, as you have suggested,<br />
x = 10;<br />
params["ParamName"] = x;<br />
<br />
after assigning values using above script... <strong class='bbc'>how should I give a call to dataset?? </strong>I mean how should I make <strong class='bbc'>data set execute using these values</strong>?... this is my concern..<br />
<br />
Please help.<br />
<br />
Thanks and Regards.
pasc
If you enter the script in the "initialize" (click on report layout - script) section of the report, the parameter will get filled with the value as soon as the report is executed.
Now when the table in the report with binding to the query with the ? (and the ? is linked to the parameter available under "Report Parameters") is drawn, the parameter will use the value you have provided in the script.
pasc
If you enter the script in the "initialize" (click on report layout - script) section of the report, the parameter will get filled with the value as soon as the report is executed.
Now when the table in the report with binding to the query with the ? (and the ? is linked to the parameter available under "Report Parameters") is drawn, the parameter will use the value you have provided in the script.
nav33n89
Hi Angioletto ,
I m not able to set report parameter values using the code :
x = 10;
params["ParamName"] = x;
Hi Pasc... still same porblem... I m unable to set value to report parameter... the code execution breaks at this point...
Thanks
pasc
This is just a quick guess:
I think you have to add the .value
x = 10;
params["ParamName"].value = x;
nav33n89
hi pasc... I have tried .value also... this doesnt work... can you please check and help me on this... m stuck on this for long
pasc
I made this example report based on the classic model database. I hope I understood what you want to do.
Just have a look at the dataset, parameter and the script. let me know if that helped.
nav33n89
hi pasc...
I tested your initialize script... its working perfect
...
now... my requirement is that I want to assign values in runtime... I mean... user fills in date and makes a selection from dropdown and then I want to assign the values entered by the user to the ReportParameter...
I m attaching my file alongwith.
here on LAYOUT... there are four scripts... pls check the third script... there I wish to assign values to reportParameters... it contains a function reportOpen() that gets executed when user finishes selecting values...
Thanks in advance.
pasc
Glad it's working on your side.
Obviously I don't work with the same version of birt, since I can't open the file. I checked the xml source but couldn't find the reportOpen() function.
nav33n89
Hi pasc..
still if you could guide me as to how can I proceed with the problem... I mean assigning user input values to report parameters and executing dataset...
pseudocode like...
x = document.getElementById("451")
params["ParamName"] = x;
Thanks and Regards
pasc
I don't think I can help any further. My inputs to this are all in the example I provided:
- It has to be params["param"].value
- If you want to assign a string to the parameter make sure it is actually a string (like in my example it has to be in '' otherwise it will give you an error)
nav33n89
Hi pasc...
Thanks for the help...
I will try this out further and post you further with the results...
Thanks again...