Hi,
My requirement is to get the number of rows in first page out 10 number of pages.
While searching in the forum, I get the below codes. But could not able to find out the methods which used in the below code using JAVA. Could you please help me to execute the below code using JAVA.
https://forum.aspose.com/t/137289
Well, you may use:
CellArea [] area = worksheet.GetPrintingPageBreaks(printoption);
Then, you can count the number of rows and read the data from each page.
e.g
Workbook workbook = new Workbook();
workbook.Open(“e:\test\book1.xls”);
Worksheet worksheet = workbook.Worksheets[0];
ImageOrPrintOptions printoption = new ImageOrPrintOptions();
printoption.PrintingPage = PrintingPageType.Default;
SheetRender sr = new SheetRender(worksheet, printoption);
int pageCount = sr.PageCount;
MessageBox.Show(pageCount.ToString());
CellArea [] area = worksheet.GetPrintingPageBreaks(printoption);
MessageBox.Show(area.Length.ToString());
//Get the first page rows.
int strow = area[0].StartRow;
int stcol = area[0].StartColumn;
int numrows = area[0].EndRow - strow + 1;
int numcols = area[0].EndColumn - stcol + 1;
Regards
Prabu R