Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have a search page .my result is shown in gridview and there is a button named print all
i write a loop to get all paths of documents(images) from grid view and print all but when result number is about 20000 and above my website hanged i want to know away to divide these documents or print these number of images
Posted
Updated 24-Aug-13 23:03pm
v2
Comments
[no name] 24-Aug-13 10:28am    
Did you stop and think for a second that maybe, just maybe, printing 20000 documents might be a tad excessive and a really, really, really bad idea in the first place?
nagiub2007 24-Aug-13 10:35am    
ok i know but its the same when number will be 1000 or more
Mahesh Bailwal 24-Aug-13 10:47am    
One thing I want to point here is that there is a separate http hit from browser to the server for retrieving every image referred in web page.
So in your case once your page is loaded browser will make 20000 hits to the server for reverting all the images and that might be the reason your page is getting hanged.
nagiub2007 24-Aug-13 10:50am    
thanks for u but can u specify which part of code causes this
Mahesh Bailwal 24-Aug-13 11:03am    
one more suggestion add check box column to your datagrid and
onclick of print all button check the numbers of rows in gridview if they are say less than 200 then print all rows images else show message to user “can not print more than 200 rows please select rows for print".
OR
You can take input from user for the range of rows user wants to print.

1 solution

I can't say why the website is hanged but in the scenario where you are printing all the documents (which may be 20,000 for now but more in future) then why don't you get the list of all those documents in the Print page from the database? I don't think it is a good idea to transfer that much big number of records from one page to another. Also, I think the issue could be in your Printing page. Just put a break point in that page and start debugging carefully; you will get to know the problem yourself.
 
Share this answer
 
Comments
nagiub2007 25-Aug-13 5:05am    
i updated the question
SaqibRasheed 25-Aug-13 16:00pm    
my answer is still valid for you. check for it and you will get the good results

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900