Reputation: 2339
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.
Upvotes: 0
Views: 4217
Reputation: 2339
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);
Upvotes: 1
Reputation: 20229
I am not sure what you mean with "filters", but you can create BIR reports that take report parameters that you can pass. e.g. pass a user (xxx) name to show a report with a query that is tailored to the specified user (aka SQL WHERE user==xxx)
Upvotes: 0