We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com


I am trying to convet following VB code into aspose cell using java.
ActiveWorkbook.Sheets(shtdata.Name).Outline.ShowLevels RowLevels:=0, ColumnLevels:=2
please let us know what is the equaling Aspose api code. I could not find it from the document.


You may try to use Cells.getGroupedRowOutlineLevel() and Cells.getGroupedColumnOutlineLevel() attributes to know the outline level of the grouped rows and columns. You need to traverse through the cells ranges (in the worksheet) to hide, show or retrieve grouped rows and columns details. See the sample code just for your reference and write your own code after understanding it:
Sample code:

        Workbook book = new Workbook("e:\\test2\\Bk_groupedrowscols.xlsx");
        Worksheet sheet = book.getWorksheets().get(0);

        int maxRow = sheet.getCells().getMaxDataRow();
        int maxCol = sheet.getCells().getMaxDataColumn();

        for (int c = 0; c <= maxCol; c++)
            int colOutlineLevel = sheet.getCells().getGroupedColumnOutlineLevel(c);
            if (colOutlineLevel ==1)
                //show grouped column  details
                sheet.getCells().showGroupDetail(false, c);



        for (int r = 0; r <= maxRow; r++)
            int rowOutlineLevel = sheet.getCells().getGroupedRowOutlineLevel(r);
            if (rowOutlineLevel > 0)
                //hide grouped rows details
                sheet.getCells().hideGroupDetail(true, r);

Hope, this helps a bit.

Thanks very much for your help. I will try out.