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. Image for the cookie policy date

Adding a page break in Excel

Hello,

I would like to add a page break in a Excel file. I need to do that dynamicaly because the line where it need to be isn't always the same.

I've tried something like :

sheet.HPageBreaks.Add(range(ligne, 1))

But it's not working.

Is adding a page break is supported in Syncfusion? If yes, how do I do it.

Thanks

Guillaume
Financial Analyst


1 Reply

JJ Jawahar Jeevanandan J Syncfusion Team July 7, 2011 07:11 AM UTC

Hi Guillaume,

Thank you very much for using syncfusion products.

Yes, Page breaks are supported in XlsIO. The following code snippet will help you to add page breaks to the work sheet.

Code Snippet(C#):

worksheet.HPageBreaks.Add(worksheet.Range["A5"]);
worksheet.VPageBreaks.Add(worksheet.Range["B5"]);

I have also attached the sample tested at our side with this update. Please try this at your side and let us know if this helps you.

By default, page breaks are not shown in the Normal view. However, you can view them by inserting new page breaks or in page break preview. I have placed the documentation link for the same. Please go through the documentation link for further reference.

Documentation Link:
http://help.syncfusion.com/ug_92/Reporting/XlsIO/ASP.NET/default.htm?turl=Documents%2Fbreaks.htm

Please let us know if you have any clarifications.

Thanks,
Jawahar.



Sample_ab662587.zip

Loader.
Live Chat Icon For mobile
Up arrow icon