Web Development

General discussion


how to incorporate page-break in asp.net

By kondas_sudha ·
Hi All,
I have n records being retrieved from the DB, bind it to a datagrid control and have set the pagination (10 records per page) attribute of the datagrid control.
But i want to introduce page breaks after every 20 records, so that whenever i use the javascript "window.print()" the entire set of data needs to be printed with page breaks after every 20 records.

I have achieved the same using ASP. But not in ASP.net and C#.

I am using .net 2003, framework 1.1.

We all know that whenever we use window.print, whatever the user is viewing in the browser will be sent for printing only.

Kindly let me know if there is any solution for this.



This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by bschaettle In reply to how to incorporate page-b ...

I achieved this by using a separate style sheet for printing, as shown here:

<STYLE media="print">
.break_before { page-break-before: always; }

Then, in your ASPX page, you'll need code that will insert the string:
into every 20th table row <tr> element of your report. Good luck.

Note that you can easily toggle the visibility of entire classes in this print-media style sheet, and make the printed edition look quite a bit different than the online edition of your report.

Related Discussions

Related Forums