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

Free Support Forum - aspose.com

Collapse its not working in case of Sheet.AutoFitColumns()

Hi,

In my excel sheet i had apply grouping fro certain column for expand and collapse.i had save the excel doc with collapse Group.And i had apply the AutoFitColumns() for all columns in excel.but after save the excel sheet group its is in expanded mode.

sheet.AutoFitColumn();

Can you please look in to it.

@sachin_bagmare,

Could you try the following code segment (where you are applying auto-fit columns) instead:
e.g
Sample code:

.........
AutoFitterOptions options = new AutoFitterOptions();
            options.IgnoreHidden = true;
            sheet.AutoFitColumns(options); 
..............

Let us know if you still find the issue.

Hi @Amjad_Sahi

You code is working but when I combine the generated workbook.
using Workbook wb = new Workbook();
wb.Combine() method and save it at that time my group is again expand instead of collapse.
you above code is not working in this case.

Can you please look in to it.

Thanks,

@sachin_bagmare,

Please create a simple console demo application (runnable), zip it and post us here with all the files, you may upload to some free file sharing service (e.g Dropbox, Google drive, etc.) and share the Download link here, we will check it soon.

Thank you.