Page Breaks not giving correct indexes

Hi Team,
PagebreaksIncorrect.png (249.9 KB)

The pagebreaks are not giving the correct index for Start Row and End Row. For reference, i am attaching the screenshot and the workbook too.

In the given workbook for page third, if we view in Page Break Preview, the Startrow = 128 and Endrow = 190

But through aspose it comes different, i have attached the screenshot for same
Wbkb.zip (10.9 KB)

. Can you pls help me

@DivyanshuSrivastava31,

Thanks for the template XLSX file and screenshot.

After an initial testing, I was able to reproduce the issue as you mentioned by using his template XLSX file and following sample code.

Workbook workbook = new Workbook("g:\\test2\\Wbkb.xlsx");

Worksheet worksheet = workbook.Worksheets[0];

ImageOrPrintOptions printoption = new ImageOrPrintOptions();
printoption.PrintingPage = PrintingPageType.Default;
SheetRender sr = new SheetRender(worksheet, printoption);
int pageCount = sr.PageCount;
Console.WriteLine(pageCount);

CellArea[] area = worksheet.GetPrintingPageBreaks(printoption);//Set the breakpoint here.

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-55315

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi team,

Since it’s a production issue due to which the reports getting generated are incorrect, i request you to please respond sooner on this part, will be helpful for us

@DivyanshuSrivastava31
Since your issue was logged yesterday (just a few hours ago), please allow us some time to evaluate and analyze it in detail. If it is not complex, we should be able to fix it soon, and the fix may be included in our upcoming release (Aspose.Cells v24.4 - planned for publication in the second week of April next month). If the issue is complex, it may take a few more weeks or even a month to resolve.

Additionally, if you purchase paid support, we will prioritize your issue so that it can be resolved earlier.

1 Like

@DivyanshuSrivastava31 ,

In the source xlsx file, the cached row height of rows that are auto-height is not right. When you open source file in Excel, Excel will automatically re-calculate the row height of rows that are auto-height. In most cases, the cached row height is right and the process of re-calculating row height is time costing, so Aspose.Cells doesn’t re-calculate the row height by default.

Please use the following code to re-calclulate the row height of rows that are auto-height, the page break will be same as the one in Excel.

Workbook workbook = new Workbook("Wbkb.xlsx");

foreach(Worksheet sheet in workbook.Worksheets)
{
    //only re-calculate row height of rows that are auto-height.
    sheet.AutoFitRows(true);
}

...

Hi John,

I am from Deloitte and we already have Aspose paid support. We are seeking for a fix on this issue on priority as it is affecting our client deliverables.

@DivyanshuSrivastava31
As @peyton.xu has replied, this issue does not require fixing or providing a fix version. You only need to add sample code to autofit rows to solve the issue. If you have any questions or confusion, please feel free to contact us at any time.

Hi John,

As we have predefined templated with custom row heights, we cannot autofit the rows because our report headers are based on those row heights which will eventually affect the reports. Please help us on same

@DivyanshuSrivastava31
Thank you for your feedback. We will further investigate your issue. Once we have any new information, we will share it with you. We will get back to you soon.

@DivyanshuSrivastava31

The code sheet.AutoFitRows(true); only re-calculates row height of rows that are auto-height, it doesn’t re-calculate row height of rows that are custom-height. When you open source file in Excel, Excel will also automatically re-calculate the row height of rows that are auto-height.