Is there a neat way to access a BIRT report's datasets to add/modify some filters. I know I can just change the XML(rptdesign) file but I'm hoping for a java method or something. By the way, I'll access it through PHP-Java Bridge because my front-end is on PHP.
2 Answers
1
votes
Ok I just don't want this left unanswered.
The solution is to access the design element, then the dataset, then add filter conditions from there.
$report = $birtReportEngine->openReportDesign("${here}/myreport.rptdesign");
$filter = new java("org.eclipse.birt.report.model.api.elements.structures.FilterCondition"); // create a new filter condition object
$filter->setExpr("row['id']");
$filter->setOperator("in");
$filter->setValue1('["32","679","333","233"]');
$report->getDesignHandle()->findDataSet("Employees")->addFilter($filter);