views:

71

answers:

0

Hello -

Problem Definition

I have a performance problem displaying large/huge resultset of data on a crystal report. The report takes about 4 minutes or more depending on the resultset size.

How do you handle large resultsets in Crystal Reports without a performance issue?

Environment

Crystal Reports XI

Apache WebSvr 2.X

Jboss 4.2.3

Struts

Java Reporting Component (JRC)

Crystal Report Viewer (CRV)

Firefox

Details

I use the CRXI thick client to build my report (.rpt) and then use it in my webapplication (webapp) under Jboss.

User specifies the filter criteria to generate a report (date range etc) and submits the request to the webapp. Webapp queries the database, gets a "resultset".

I initialize the JRC and CRV according to all the specifications and finally call the "processHttpRequest" method of Crystal Report Viewer to display the report on browser.

So.....

  • Request received to generate a report with a filter criteria

  • Query DB to get resultset

  • Initialize JRC and CRV

  • finally display the report by calling

    reportViewer.processHttpRequest(request, response, request.getSession().getServletContext(), null);

The performance problem is within the last step. I put logs everywhere and noticed that database query doesnt take too long to return resultset. Everything processes pretty quickly till I call the processHttpRequest of CRV. This method just hangs for a long time before displaying the report on browser.

CRV runs pretty fast when the resultset is smaller, but for large resultset it takes a long long time.

I do have subreports and use Crystal report formulas on the reports. Some of them are used for grouping also. But I dont think Subreports is the real culprit here. Because I have some other reports that dont have any subreports, and they too get really slow displaying large resultsets.

Solutions?

So obviously I need a good solution to this generic problem of "How do you handle large resultsets in Crystal Reports?"

I have thought of some half baked ideas.

A) Use external pagination and fetch data only for the current page being displayed. But for this, CRXI must allow me to create my own buttons (previous, next, last), so I can control the click event and fetch data accordingly. I tried capturing events by registering event handler "addToolbarCommandEventListener" of CRV. But my listener gets invoked "after" processHttpRequest method completes, which doesnt help.

Some how I need to be able to control the UI by adding my own previous page, next page, last page buttons and controlling it's click events.

B) Have CRXI use a jquery type of functionality, to allow browser side page navigation. So maybe the first time it'll take 5 mins to display the report, but once it's displayed, user can go to any page without sending the request back to server.

C) Try using Crystal Reports 2008. I'm open to using this version, but I couldnt figureout if it has any features that can help me.

D) Use BIRT or JasperReports, since they apparently have the ability to handle large datasets, by caching a part of the dataset on disk etc...

E) Will using the Crystal Reports Servers like cache server, application server etc help in any way? I read a little on the Crystal Page Viewer, Interactive Viewer, Part Viewer etc....but I'm not sure if any of these things are going to solve the issue.

I'd appreciate it if someone can point me in the right direction.