Not able to set row group to collapsed by default

Hi,
This is with the groups in rows or columns (collapsed as default). On standalone application this works like charm, I am able to get collapsed groups (rows/columns), but when I do the same on my application the group is exported as expanded, is there any setting by which the sheet or workbook is un-collapsing the groups.

Below is the code which creates the collapsed group (column).
worksheet.getCells().groupColumns(2, 4, true); // collapsed by default (works on standalone)

thanks and regards,
Mahesh Pujari

Hi,


Well, Aspose.Cells is just a component that is used to manage and manipulate Excel spreadsheets, it does not do anything special in diverse platforms or different scenarios. It will work equally fine on any JAVA supported runtime (installed) in most cases.

If it works fine on your standalone application, then it should equally work fine on your application. Could you give us your environment details, OS, JDK version etc. Also, provide your runnable code and exported Excel file here. We will check it soon. Also which version of the product you are using? We recommend you to kindly try our latest version v7.3.0 (downloading it from the Aspose site).

Thank you.

Hi,
I do understand what you mean :)…what I am trying to understand is, is there any setting by which the collapsed and un-collapsed are managed, because same piece of code which is used for group () works (below is the sample code), and what I mean by standalone application is, I am just loading the workbook and grouping rows and columns…where as in our application we do some (lot) of house keeping stuff (as its proprietary and huge I can’t provide you the code).
I sure there is some setting which is causing group to be un-collapsed even if I used used the api Cells.groupRows(int,int,boolean)/Cells.groupColumns(int,int,boolean).

Well we use Windows XP (Version 5.1), Java version is 1.6.0_25, product version is aspose-cells-7.1.2.jar (used in production and on local). As we are in production I don’t think we will be updating with latest version of Aspose, if included then we have to have a round of testing (time consuming) and I think higher management would not recommend. But I will give it a try on my local.

thanks and regards,
Mahesh Pujari

Hi,

We think maybe you have done some other operations on the cells that change the visiblility of grouped rows/columns(from hidden to visible so that those grouped rows/columns became expanded for the group). Please move your code of grouping rows/columns to the last before saving the workbook to check whether you can get desired result.

Hi,
Got the issue, the issue was when we are saving we are explicitly calling “autoFitRows()” on sheet, this is making collapsed rows to expand. Not sure if this is documented :slight_smile: (may be documented which I missed)

many thanks…
Mahesh Pujari

Hi,


Well, when you call autoFitRows() function, it will surely unhide the hidden rows or grouped collapsed rows, this behavior is same as MS Excel, you may confirm it.

Thank you.