views:

491

answers:

8

Hello

I have some tables in my database with about 7K rows and I need to make a report on the web site( asp.net ) with custom formating, pivot table like details.

What is the best solution for this, because when I render for example repeater with this amount of data it`s very slow.

Thanks for advice

+1  A: 

I would suggest using paging.

kevchadders
If it is possible, I don`t want paging.Because users in desktop application use scrolling a lot and it`s very comfortable.so scrolling is good for me :)
Cicik
+2  A: 

Turn off the viewstate

Unless you need it

Page.EnableViewState = false;

Split the table

If you don't want to go down the paging route you could also try splitting a large <table> into several smaller <table>s. (It used to be the case that the browser could only render a table after it has seen the final </table>. I'm not sure if this is still true, but definitely worth a shot)

Get rid of crap

Ensure that you are using css and not using stuff like

<td width="40" valign="top"> 50 </td>
<td class="a"> 50 </td> <!-- better  -->
<td>50</td> <!-- best  -->
<!-- if you need to specify a width, you only need to do it in one row  -->

Remember crap * 7000 = alot of crap

Reduce page size at all costs

Sometimes the problem is not rendering of the page, but it is the downloading that causes the problem, so check that out.

Nested tables will really hurt you

Nuff said

DrG
A: 

May want to try a custom reporting tool for that much data. My company make a tool called RSinteract (shameless plug). That uses SQL Server reporting services.

If you just want to dump the data. I presume the browser is locking up while it renders that or while the query is running. If you know what your target browser is... you could use a "More..." link to get the next set of data and have a 1000 row limit. However this would impact Ctrl+F searching. Similar to paging but putting the responsibility into the hands of the user I guess.

Rob Stevenson-Leggett
+1  A: 

If you don't want paging, then you'll probably need some AJAX to fetch rows as you scroll, and possibly remove rows as they scroll out of view, if you need to conserve memory.

mbeckish
A: 

Considering a typical row like this:

<tr><td>ID</td><td>Some data</td><td>More and more data</td></tr>

Each row has 66 characters, so having 7k rows would sum up almost 500k worth of data. And that's a lot for a web display.

So if you really want to display everything in one page, keep it minimal:

  • Don't waste spaces
  • Don't use attributes unless completely unavoidable
  • Don't use class="" if you don't have different classes for different rows (apply the same class to all rows instead)

Anyway, depending on the target computer + browser, this could get really slooow if your rows are larger.

Seb
I have 19row so it` IS a lot of data
Cicik
A: 

If you're really looking for the "best" solution for a "web app", I'd blatantly suggest that you use Flash/Flex for efficiently rendering that many rows. If using anything beyond basic HTML is not an option, then I would suggest dynamically fetching new rows as the user scrolls as @mbeckish suggested...

Ates Goral
+1  A: 

You dont mention which language you're using, but the mention of a repeater suggests ASP.Net? In my experience, binding data to a DataGrid is quicker on larger data sets.

BUT, I have to wonder why you would want to display that much data on a web page. No user in their right mind would sit and scroll through that much data and find it useful. Limit your data to pertinent data that will be useful to the user - generally filtered to less than 100 rows.

IMO, a report with this much data is useless, no matter the format, but if you absolutely have to have it all for a printed report or such, consider generating a PDF document on the server instead.

A: 

I used Dev Express grids for one client to deal with reporting and they love it (although I would have rather have rolled my own!)

See http://demos.devexpress.com/ASPxGridViewDemos/

AJM