We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Insert Page Break

Thread ID:

Created:

Updated:

Platform:

Replies:

56634 Feb 17,2007 09:56 AM Feb 19,2007 12:57 AM ASP.NET Web Forms (Classic) 1
loading
Tags: XlsIO
Chad Dunham
Asked On February 17, 2007 09:56 AM

Is there an example of how to insert a page break into an excel document?

Thanks

Chad

Melba Winshia [Syncfusion]
Replied On February 19, 2007 12:57 AM

Hi Chad,

Thanks for your interest in Essential XlsIO.

To insert a page break in a worksheet, please insert vertical and horizontal page breaks at the specified cell by calling the Add method. Please refer the following code snippet which illustrates the above:

[C#]

//Entering text into the cells
sheet.Range[ "A1:M20" ].Text = "PageBreak";

// Giving Horizontal pagebreaks
sheet.HPageBreaks.Add( sheet.Range[ "A5" ] );
sheet.HPageBreaks.Add( sheet.Range[ "A10" ] );
sheet.HPageBreaks.Add( sheet.Range[ "A15" ] );

// Giving Vertical pagebreaks
sheet.VPageBreaks.Add( sheet.Range[ "B5" ] );
sheet.VPageBreaks.Add( sheet.Range[ "E10" ] );
sheet.VPageBreaks.Add( sheet.Range[ "K15" ] );

Here is the sample for your reference:

PageBreak.zip

Kindly take a look at the sample above and let me know if you have any other questions.

Regards,
Melba

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;