tags:

views:

987

answers:

3

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.

A: 

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)

lothar
A: 

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);
Gian Basagre
A: 

@Gian Basagre Is this javascript you have used to write the code to add filter to the BIRT report?

ankitKinra