Hi BIRT Guru,
we are struggling to find any solution on this particular scenario, Hope you guys will have some solution.
I am reading the .rptdocument, and want to hide all other element other than one widget, using some condition.
Condition is : when the URL is (for ex) :
http://localhost:8080/birt/frameset/__bookmark=mytable&__report=myreport.rptdesign&isreportlet=false&__document=myreport.rptdocument
Can assume here that the myreport.rptdocument is already generated and trying to read it.
In the report I have some other widgets also like "mychart1", "mychart2", "mytable2" .....blah-2.
I want to hide all those elements and show only "mytable".
now this is what we tried till now :
I tried hiding all elements when condition(__bookmark.equals("mytable")) is true.
I used this script in "beforeRender" of "reportDesign"; but did not get the result.
/********************** Script in BEFORERENDER OF REPORT *****************************************/
delmG = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("mychart1");
hr = StructureFactory.createHideRule();
//hr.setFormat(DesignChoiceConstants.FORMAT_TYPE_HTML);
hr.setFormat("html");
/****************** Expression for Hidding the items ***************************/
request = reportContext.getAppContext().get("BIRT_VIEWER_HTTPSERVET_REQUEST");
bookMarkParam = request.getParameter("__bookmark");
expression = "false";
if((bookMarkParam != null) && bookMarkParam.equals("mytable")) {
expression = "true";
}
/********************************************************************************/
hr.setExpression(expression);
phG = delmG.getPropertyHandle("visibility");
phG.addItem(hr);
/********************** End of Script *****************************************/
Any positive response is highly appriciable.
Thanks