Search code examples
c#.netweb-servicesdevexpressxtrareport

How to improve performance of XtraReports using a web service to get the data?


I'm facing a potential problem using the XtraReports tool and a web service about performance. in a Windows Form app.

I know XtraReport loads large data set (I understand a large data set as +10,000 rows) by loading the first pages and then continue loading the rest of the pages in the background, but all this is done with a data source in hand. So what happens if this data source has to pass through a web service, which will need to serialize the data in order to send it to the client?

The scenario is the following:

I have a thin client in windows form that makes calls to a web service, which takes that call and by reflection instantiates the corresponding class and calls the required method (Please notice that this architecture is inherited, I have almost no choice on this, I have to use it). So I'll have a class that gets the data from the database and send it to the client through the web service interface. This data can be a DataSet, SqlDataReader (also notice that we're using SQL Server 2000, but could be 2008 by the end of the year), DataTable, XML, etc.

If the result data set is large, the serialization + transference time can be considerable, and then render the report can add some more time, degradating the overall performance.

I know that there is a possibility for using something like streaming video, but for streaming data through a web service but I have no lead info for trying something around it.

What do you think about this? Please let me know any questions you may have or if I need to write more info for better statement of the problem.

Thanks!


Solution

  • I'll give you an answer you probably don't want to hear.

    Set expectations.

    Reports are typically slow because they have to churn through a lot of data. There just isn't a good way to get around it. But barring that, I'd do the following:

    1. Serialize the data load to a binary state, convert to something transferable via soap (base64 for instance) and transfer that. This way you'll avoid a lot of useless angle brackets.
    2. Precache as much data on the client as possible.
    3. Focus on the perceived performance of the application. For instance, throw the report data gathering onto a background thread, so the user can go and do other work, then show the user a notification when the report is available.
    4. Sometimes, it is possible to generate the report for the most often used criteria ahead of time and provide that when asked.