views:

630

answers:

3

Hello,

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!

+1  A: 

Hi, transfering DataSets is a bad idea. DataSet have a lot of unusefull date. Use Simple Objects. Use ORM on server side. Also you can precalculte some data. Referencies can be cached on client and then joined with server data.

merin
Hi, I can't use an ORM, that's not "negotiable" because this is a already set architecture where I must live in. I saw another answer (don't know why I can't see it anymore) that says that I could just partition the data. Let's suppose I can, how do I make the XtraReport to show partitioned data? The only thing I can think of is to show paged data, like have a butto in the viewer that says "Next 100 results" and ask for them to the web service. Don't know if that's possible.
Sebastian
+1  A: 

Is there a way you can partition the data, ie return a small subset of it?

If there's no absolute requirement to return all the data at the same time, then dividing up the data into smaller pieces will make a huge difference when reading from the database, serializing, and transporting through the webservice.

Edit: I had deleted this answer since you already mentioned partitioning. I'm undeleting it now, maybe it will serve some use as the starting point of a discussion...

As for your point about how to work with paging: I think you're on the right track with the "Show next 100 results" approach. I don't know how XtraReport works, and what its requirements for a datasource are. There are 3 issues I see:

  • Server support for partitioned data (eg your webservice should support returning just "page 3"'s data
  • Summary Data - does your report have a row of totals or averages? Are those calculated by the XtraReport control? Does it require a complete dataset to display those results? Can you provide the summaries to the control on your own (and find a more efficient way to calculate them without returning the entire data set?)
  • XtraReport support for a datasource that uses paging.
Nader Shirazie
The issue about summary data is a good one, thanks, I didn't have that in mind at this time. +1
Sebastian
+1  A: 

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.
AngryHacker