Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to fetch table row from list in reverse order?
RowanMaclaren
I am using a Scripted Data Source in a table. The datasource is a Java method that returns a List. I would like to present the table rows in the reverse order returned by the Java method without the overhead of sorting. I would simply like the iterator to fetch from the List in reverse order. Is there a way to control the scripted data source list iterator? [I cannot change underlying data order in the Java method, and I would like to avoid reversing the list if possible]. <br />
<br />
Thank you.<br />
Rowan Maclaren
Find more posts tagged with
Comments
RowanMaclaren
I forgot to mention that I am using BIRT 2.2.
rmurphy
When you initialize the scripted data set, get the size of the List from the object and hold onto it. In your onFetch method use the get(int index) method of the list. Rather than using the typical increment of a counter , just decrement (x-- instead of x++) the counter to loop through it backwards.
Rob