Hi Craig,
Thank you for creating a new thread for the 2nd part of your inquiry as posted here. Please note, I have tried to optimize your provide code to get the scenario working however, I have noticed that specified style is not being applied to the new column if inserted immediately before the PivotTable of your provided sample spreadsheet. Moreover, PivotTable’s styling is disturbed too. Please note, if I manually insert a new column with Excel application at same location, I can style it as desired. Also, if I manually insert a column at index 0 and process it with code as attached, the result is correct. I have logged an investigative ticket with Id CELLSJAVA-41970 for product team’s review. Please spare us little time to schedule the analysis and revert back with updates as soon as we have completed the preliminary analysis.
That said, please check the attached txt file for the updated code. Please note, there are mainly 2 changes as detailed below.
- You do not need to set the borders for all worksheet contents before rendering it to HTML because recent revisions of the Aspose.Cells APIs have exposed the HtmlSaveOptions.ExportGridLines property. Setting it to true will render the grid lines in the resultant HTML.
- You do not need to iterate over each cell to apply the style. You can simply create a range of the cells and apply the style to each and every cell in the range in a single statement.
Hi Craig,
The issues you have found earlier (filed as CELLSJAVA-41970) have been fixed in Aspose.Cells for Java 24.8.