[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Pagination

Hi,

(I use Report engine API with a JSP to render rptdesigns)
We have huge transactional data, and displaying all the data in one go doesnt work because Birt fetches everything in one shot (this is perhaps due to the Grouping feature). I have implemented custom pagination to get around the above - i maintain the same queries in a JSP, and when user hits a report, prepend count(*) before the actual query, get the count, and depending on user requested page, use SQL and rowNum tricks to return the particular "page". So far, so good.
The problem now has become of maintenance - the SQL queries themselves are reasonably complex, and you could say they are crafted, and the exact query gets determined only at run time based on user input, and with lots of logic spinning. I maintain all the query generation logic in an rptlibrary, and in the pagination jsp. Every change in the rptlibrary, means a change in the pagination jsp (and sometimes i forget !!).


I was wondering if there's some way I could "Preview" the actual Query by passing the set of report parameters to an rptdesign. So, something like public String ReportEngine.getDataQuery(ReportDesign rptdesign, Map reportParams) returns the SQL that would get passed to JDBC

Then I wouldnt need to maintain the heavy baggage in two places. At run time, before actually rendering the report, I would use "SQL Preview", get hold of the query, prepend count(*) and so on..

Couldnt find anything in the API, so just wanted to bounce it off the experts.

Thanks for your time