Add header in each page of print with top border

Author Topic
nithya priyadarshini
Member

Joined: 28 Dec 2007
Country:
Posts: 1

Posted: 28 Dec 2007 06:31:33

Hi all,

I was looking for the solution to add header in each page of print when trying to print the data grid, and I found the following code from a forum:

function print_header()
{
var table = document.getElementById("dgReport"; // the id of your DataGrid<BR>
var str = table.outerHTML;
str = str.replace(/<tbody>/i, "";
str = str.replace(/<tr/i, "<thead style='display:table-header-group'><tr";
str = str.replace(/<\/tr>/i, "</tr></thead></tbody>";
table.outerHTML = str;
}

It is working very fine except not printing the Top border of header after first page. The second, third and consequent pages printing header without top border.

Can anyone help me to find out whats wrong and how to fix?

Thanks a lot.

Regards
Nithya.A

Hi all,

I was looking for the solution to add header in each page of print when trying to print the data grid, and I found the following code from a forum:

function print_header()
{
var table = document.getElementById("dgReport"; // the id of your DataGrid<BR>
var str = table.outerHTML;
str = str.replace(/<tbody>/i, "";
str = str.replace(/<tr/i, "<thead style='display:table-header-group'><tr";
str = str.replace(/<\/tr>/i, "</tr></thead></tbody>";
table.outerHTML = str;
}

It is working very fine except not printing the Top border of header after first page. The second, third and consequent pages printing header without top border.

Can anyone help me to find out whats wrong and how to fix?

Thanks a lot.

Regards
Nithya.A
Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency