Free Support Forum - aspose.com

Setting PageBreaks in a excel worksheet

I am using Aspose Cells version - 1.9.0.0. I am trying to set the Page Breaks.

I have few questions.

I am using the following code

Worksheet workSheet = null;
workSheet = m_workBook.getWorksheets().getSheet(“Test”);
// Horizontal PageBreak
int iHorizontalPageBreak = 30;
// Vertical PageBreak
int iVerticalPageBreak = 10;

workSheet.addPageBreaks(iVerticalPageBreak,iHorizontalPageBreak);

When I use the above code, I am not seeing the Pagebreaks at the specified location 30 and 10.
I am seeing multiple Page breaks. Please find the attached snapshot, where I see 4 pages.

1. Please help me to resolve the issue.

2. When do I need to use the following code, which is related HPageBreaks and VPageBreaks

HPageBreaks objHPageBreaks = m_workSheet.getHPageBreaks();

objHPageBreaks.add(iHorizontalPageBreak);

VPageBreaks objVPageBreaks = m_workSheet.getVPageBreaks();

objVPageBreaks.add(iVerticalPageBreak);

Your help is appreciated.

Regards,

Praveen S D

Hi Praveen,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We have found your mentioned issue regarding setting page break after an initial test. We will look into it and get back to you soon. Your issue has been registered in our internal issue tracking system with issue id: CELLSJAVA-14590.

Thank You & Best Regards,

Hi,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please try the attached latest version of Aspose.Cells. If you still face any problem, please share your template file with sample code to reproduce the issue. We will check it soon.

Thank You & Best Regards,