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

Excel Page Break not working on setting FitToPagesTall

Thread ID:





95276 Jun 29,2010 03:40 PM UTC Jul 8,2010 01:33 PM UTC ASP.NET Web Forms (Classic) 5
Tags: XlsIO
Bala Vennelaganti
Asked On June 29, 2010 03:40 PM UTC

I have a requirement to fit 3 tables per page and compressed so that it does not take many pages.

I am using a page break after 3 tables are inserted in Excel and at the end of the excel generation. I set the page size to fit such that pages are fixed size.

sheet.PageSetup.FitToPagesTall = (For eg: 3, I set the value based onsome logic w.r.to rows on sheet)

My issue is that the page break is not working and the table is cut in the middle.

Please advise


Bala Vennelaganti
Replied On June 30, 2010 02:31 PM UTC

Please let me know if there are any other ideas.

Lokesh R [Syncfusion]
Replied On June 30, 2010 03:22 PM UTC

Hi Bala,

Thank you very much for your interest in Syncfusion products.

We are very sorry for the delay caused in getting back to you.Could you please send us a simple issue reproducing sample, with the Excel template and also the current Essential studio version you are using in your project. So that we can further analyze on this issue.

Please, let us know if you need any clarifications.


Bala Vennelaganti
Replied On July 2, 2010 06:36 PM UTC

Hi Lokesh,
Here is the code. Please test and let me know if I need to make any changes. I put a page break after every 50 lines and set the page tall size to 5 pages. I guess this is not a perfect example but in our case I need to break at a point when the header changes. so I need page break to work along with FitToPagesTall.

Appreciate your help

#region TestSyncfusionXslIO
public void TestSyncfusionXslIO()
int row = 1, column = 1;
#region Syncfusion XLS definition
//New instance of XlsIO is created.[Equivalent to launching MS Excel with no workbooks open].
//The instantiation process consists of two steps.
//Step 1 : Instantiate the spreadsheet creation engine.
ExcelEngine excelEngine = new ExcelEngine();
//Step 2 : Instantiate the excel application object.
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Create(3);
HttpResponse response = HttpContext.Current.Response;
IWorksheet sheet = workbook.Worksheets[0];

for (int i = 0; i < 500; i++)
sheet[row, 1].Text = "Page Break applied after every 50 Lines. Page Tall size set to 5. Does not break... Here is Line "+i.ToString();

if (row%50==0)
sheet.HPageBreaks.Add(sheet[row, column]);

sheet.PageSetup.FitToPagesTall = 5;
sheet.PageSetup.FitToPagesWide = 1;
workbook.SaveAs("TEST", ExcelSaveType.SaveAsXLS, response, ExcelDownloadType.PromptDialog);


Bala Vennelaganti
Replied On July 7, 2010 01:21 PM UTC

Hi Lokesh/Syncfusion team,
Any ideas or suggestions


Lokesh R [Syncfusion]
Replied On July 8, 2010 01:33 PM UTC

Hi Bala,

We are very sorry for the delay caused in getting back to you.

We could see the issue at our side and logged an issue report and forwarded to the development team for further analysis. So we request you to open a new ticket to further follow up on this issue. We are sorry for the inconvenience caused.

Direct trac link:

Please, let us know if you need any clarifications.



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