Call window.print() inside loop
-
Hi All, I want to print my .aspx page with data while its running inside a loop. For E.g My loop is till dt.rows.count and in every loop I Want to print the page with data. If count is 7 than 7 pages need to be printed.
-
Hi All, I want to print my .aspx page with data while its running inside a loop. For E.g My loop is till dt.rows.count and in every loop I Want to print the page with data. If count is 7 than 7 pages need to be printed.
-
Hi All, I want to print my .aspx page with data while its running inside a loop. For E.g My loop is till dt.rows.count and in every loop I Want to print the page with data. If count is 7 than 7 pages need to be printed.
This is more a CSS issue. You can't print to the client's machine via asp.net code, and your asp.net code runs in its entirety before sending anything to the client so you can't "loop" the way you are intending. Instead send all 7 pages to the client with the relevant css that designates where the page breaks are and the client will need to print from their browser (no you can't do that automatically either, neither can you force them to print) and the documents will be on their own pages. Google for css page breaks or for print style css in general.
-
This is more a CSS issue. You can't print to the client's machine via asp.net code, and your asp.net code runs in its entirety before sending anything to the client so you can't "loop" the way you are intending. Instead send all 7 pages to the client with the relevant css that designates where the page breaks are and the client will need to print from their browser (no you can't do that automatically either, neither can you force them to print) and the documents will be on their own pages. Google for css page breaks or for print style css in general.
Thanks for your reply.. I have found the solution using jquery function window.open inside loop..