How to print header in each page

Author Topic
Renukadevi Shanmugasundaram
Member

Joined: 14 Jul 2006
Country: Australia
Posts: 15

Posted: 03 Nov 2006 04:08:04


Hi all,

I have a data grid to list rows and am printing from IE using javascript window.print(). Its working very fine. But I like to print header in each page of my print. Is it possible?

Also I am using the following script to set up the page break after printing 15 items in a page. It is working all right. Is there any other way to insert page break after certain page margin?

private void dgResults_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
count++;
if(count > 15)
{
e.Item.Style.Add("page-break-after","always";
count = 0;
}
}
}

Is there any similar way to add header in each page? Or is it possible to add ListItemType.Header in the middle?

Thanks and Regards
Renu





Hi all,

I have a data grid to list rows and am printing from IE using javascript window.print(). Its working very fine. But I like to print header in each page of my print. Is it possible?

Also I am using the following script to set up the page break after printing 15 items in a page. It is working all right. Is there any other way to insert page break after certain page margin?

private void dgResults_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
count++;
if(count > 15)
{
e.Item.Style.Add("page-break-after","always";
count = 0;
}
}
}

Is there any similar way to add header in each page? Or is it possible to add ListItemType.Header in the middle?

Thanks and Regards
Renu




Detail Oriented
Member

Joined: 27 Oct 2006
Country:
Posts: 7

Posted: 06 Nov 2006 06:04:42

If I understand you right . You want to add a header to each page...and then print it...

You can have a usercontrol with the header and load it either at desgn time or runtime.

DesignTime:
Create user control
Drag it from the solution explorer onto every page.

RunTime:
Create user control
Add a classname to the usercontrol.
Add a reference directive to the page
Load the control

Hope this helps!!

If I understand you right . You want to add a header to each page...and then print it...

You can have a usercontrol with the header and load it either at desgn time or runtime.

DesignTime:
Create user control
Drag it from the solution explorer onto every page.

RunTime:
Create user control
Add a classname to the usercontrol.
Add a reference directive to the page
Load the control

Hope this helps!!
Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency