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)
Adding HTML code and getting value back to BIRT parameters
SDagenais
Hi,<br />
<br />
Using BIRT 2.3.2 with MAXIMO 7.1.1.6.<br />
<br />
I am facing an issue with a report that i have and have been searching and testing for a while, with no real solution. I've added a Text element which i've add some HTML code, to create radio button on the report. Once selecting any button, i would like to update a BIRT parameter so i could go to a detail report with this new value and the others selected from my selection criteria screen.<br />
<br />
<script><br />
function changeparams() {<br />
for (var i=0; i < document.radioButton.DetailRptType.length; i++)<br />
{<br />
if (document.radioButton.DetailRptType
.checked)<br />
{<br />
var rad_val = document.radioButton.DetailRptType
.value;<br />
}<br />
}<br />
rdbt = '';<br />
rdbt=rad_val;<br />
<br />
params["DetailRptType"].value="TEST"; <br />
}<br />
</script><br />
<form METHOD="post" onclick="changeparams()"> <br />
<input type="radio" checked name="DetailRptType" value="Compliant"> Compliant </input><p><br />
<input type="radio" name="DetailRptType" value="Non-Compliant"> Non-Compliant </input><p><br />
<input type="radio" name="DetailRptType" value="Backlog"> Backlog </input><p><br />
<input type="radio" name="DetailRptType" value="Cancelled"> Cancelled </input><p><br />
<input type="submit" value="Submit"><br />
</form><br />
<br />
on my report, on the beforeFactory, i've add the following code, which does an hyperlink to my detail report BUT my params["DetailRptType"], is not populate:<br />
<br />
importPackage(Packages.org.eclipse.birt.report.model.api);<br />
importPackage(Packages.org.eclipse.birt.report.model.api.elements);<br />
<br />
<br />
dataHandle = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("mydataelement");<br />
<br />
ac = StructureFactory.createAction();<br />
ah = dataHandle.setAction( ac );<br />
ah.setLinkType("drill-through");<br />
ah.setReportName( "92_Test_HTML.rptdesign");<br />
ah.setTargetFileType("report-design");<br />
ah.setTargetWindow("_blank");<br />
pb = StructureFactory.createParamBinding();<br />
pb.setParamName("location");<br />
pb.setExpression("params[\"location\"]");<br />
ah.addParamBinding(pb);<br />
pb1 = StructureFactory.createParamBinding();<br />
pb1.setParamName("DetailRptType");<br />
pb1.setExpression("params[\"DetailRptType\"]");<br />
ah.addParamBinding(pb1);<br />
<br />
Does anyone have ideas or suggestions on this issue that i am facing ?<br />
<br />
Regards,<br />
<br />
Stephane
Find more posts tagged with
Comments
cdoniat
Hi Stephane,
I'm using BIRT 2.6.1.
I've got the same issue. I've followed the best practice here :
http://esitnikov.blogspot.com/2010/01/birt-best-practice_5227.html
, which is the same process you described. I asked him anyway. I didn't get any reply yet.
Let me know if you point out how to do from this best practice.
Christophe