Generic application with pagedReportData method using filter and includeLayout options
This example retrieves a portion of the report, and then parts of it are selected.
The report is run using the getPagedReportData
method
with a filters
element
to select the crosstab ( filterType
= OBJECT_ID
and filterValue
= Crosstab1
.).
A snippet of the LDX output is shown here.
<filterResultSet...
<filterResult>
<filterType>OBJECT_ID</filterType>
<filterValue>Crosstab1</filterValue>
<reportElement>
<ctab>
<id>Crosstab1</id>
...
<table>
<row>
<cell>
...
<cell>
...
<item>
<txt>
...
<val>0.0294117647058824</val>
...
The following code snippets show how the highlighted value can be retrieved.
- C# example
LDXOutputType ldx = response.output.Item as LDXOutputType; FilterResultSet frs = response.output.Item as FilterResultSet; CrossTab ctab = frs.filterResult[0].reportElement[0].Item as CrossTab; TextFrame txt = ctab.table[0].cell[1].item[0].Item as TextFrame; String value = txt.val as String;
- Java™ example
value = resp.getOutput().getLDXOutput().getFilterResultSet().getFilterResult(0) .getReportElement(0).getCtab().getTable()[0].getCell(1).getItem(0).getTxt().getVal();