cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the filters of Webi document/Report using Java code in XI SDK.

Former Member
0 Kudos

Hi All,

I have a requirement where i have to extrcat filters from the Webi Document.using java SDK.

I am trying to find the class called "filterable"but not able to use in my java code and will get always

"java.lang.ClassCastException com.businessobjects.wp.om.OMDocument cannot be cast to com.businessobjects.rebean.wi.Filterable"

I am using the below java code like

ReportElement re=document.getStructure()

FilterContainer flt=((Filterable) re).getFilter()

I am stuck and need this in uregent.

Please help.

Accepted Solutions (0)

Answers (1)

Answers (1)

dan_cuevas
Active Participant
0 Kudos

Hi Rajeev,

To retrieve a FilterContainer you will need to traverse the report structure:


ReportStructure boReportStructure = boDocumentInstance.getStructure();
ReportContainer boReportContainer = (ReportContainer) boReportStructure.getReportElement(0);

FilterContainer boFilterContainer = null;
if (boReportContainer.hasFilter()) {
     boFilterContainer = boReportContainer.getFilter();
} else {
     boFilterContainer = boReportContainer.createFilter(LogicalOperator.AND);
}

Calling boDocumentInstance.getStructure() will retrieve the entire structure for the document.

Calling boReportStructure.getReportElement(0) will retrieve the structure for the first report of the document.

Hope this helps.

Regards,

Dan