In the .NET version, I'm trying to control the order of worksheets inside a workbook. I want them to appear in the order in which I create them. I tried to use worksheet.Move to move the newly-created sheet to the end but I get unpredictable results. It appears that Aspose is sorting the list by name under certain conditions. How can I control this behavior?
I don't find any issue with the ordering of the worksheets in a workbook. It is set the way I am creating the worksheets in the workbook. For your info, if you create a workbook from the scratch, a default worksheet named "Sheet1" is automatically created, so you have keep in mind that and add new worksheets keeping in mind that or you 'd better clear the worksheets before adding new ones.
E.g.,
Workbook workbook = new Workbook(); workbook.Worksheets.Clear(); for (int i = 0;i<20;i++) { workbook.Worksheets.Add(); Worksheet worksheet = workbook.Worksheets[i]; . . } workbook.Save("d:\\test\\twentysheets.xls");
If you still find any issue, could you create a sample code to reproduce the unpredictability.