Click here to Skip to main content
15,905,323 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

I am trying to print a scrollable gridview which has ‘n’ number of columns. I have a print button on my aspx page. assume tat these 'n' no of columns cant be printed in a single page so i need to print in two or more pages. pls kindly help me with the code.


With regards,
Premkumar Duraiswamy.
Posted
Comments
Sergey Alexandrovich Kryukov 4-Jul-11 17:30pm    
Do you use WPF, Forms or something else (ASP.NET?) Tag it!
--SA
Sergey Alexandrovich Kryukov 4-Jul-11 17:31pm    
Tag your language as well!
--SA

1 solution

Print data, not the control content. Use data-centric approach. You should have some data source used to populate the grid, based on data binding or not.

Use the same data source for printing, regardless of data presentation on screen. Use the class System.Drawing.Printing.PrintDocument, see documentation and code sample here: http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx[^].

—SA
 
Share this answer
 

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