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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Insert Page Break

Thread ID:





56634 Feb 17,2007 02:56 PM UTC Feb 19,2007 05:57 AM UTC ASP.NET Web Forms (Classic) 1
Tags: XlsIO
Chad Dunham
Asked On February 17, 2007 02:56 PM UTC

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



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

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:


//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:


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



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon