Create PDF bookmark for Chart sheet, exclude unused Styles and export document properties in Excel to HTML conversion using Aspose.Cells for .NET 18.1

Aspose.Cells for .NET logo
We are pleased to announce the release of Aspose.Cells for .NET v18.1. We have added some useful features and enhancements regarding Pivot Tables, Charts and Excel to HTML renderings. Please check the release notes in order to get an idea about what is new and what has been enhanced or fixed with this revision of Aspose.Cells for .NET. You can also install Aspose for .NET APIs directly from NuGet repository.

Create PdfBookmarkEntry for Chart Sheet

In previous versions, we can create PdfBookmarkEntry for normal sheets only. But now Aspose.Cells can also create PdfBookmarkEntry for chart sheet. Since, chart sheet does not have any other cell except cell A1, so it will create PdfBookmarkEntry for cell A1 only. The following sample code loads an Excel file which has four sheets in it. Two of them are normal sheets and others are chart sheets. It creates four bookmarks, one for each sheet.

//Load sample Excel file
Workbook wb = new Workbook("Book1.xlsx");
//Access all four worksheets
Worksheet sheet1 = wb.Worksheets[0];
Worksheet sheet2 = wb.Worksheets[1];
Worksheet sheet3 = wb.Worksheets[2];
Worksheet sheet4 = wb.Worksheets[3];
//Create Pdf Bookmark Entry for Sheet1
PdfBookmarkEntry ent1 = new PdfBookmarkEntry();
ent1.Destination = sheet1.Cells["A1"];
ent1.Text = "Bookmark-I";
//Create Pdf Bookmark Entry for Sheet2 - Chart 
PdfBookmarkEntry ent2 = new PdfBookmarkEntry();
ent2.Destination = sheet2.Cells["A1"];
ent2.Text = "Bookmark-II-Chart1";
//Create Pdf Bookmark Entry for Sheet3 
PdfBookmarkEntry ent3 = new PdfBookmarkEntry();
ent3.Destination = sheet3.Cells["A1"];
ent3.Text = "Bookmark-III";
//Create Pdf Bookmark Entry for Sheet4 - Chart 
PdfBookmarkEntry ent4 = new PdfBookmarkEntry();
ent4.Destination = sheet4.Cells["A1"];
ent4.Text = "Bookmark-IV-Chart2";
//Arrange all Bookmark Entries
ArrayList lst = new ArrayList();
ent1.SubEntry = lst;
//Create Pdf Save Options with Bookmark Entries
PdfSaveOptions opts = new PdfSaveOptions();
opts.Bookmark = ent1;
//Save the output Pdf
wb.Save("outputCreatePdfBookmarkEntryForChartSheet.pdf", opts);

Please see the document/article with attachment(s) on how to create bookmarks for chart sheet for your reference.

Exclude unused Styles during Excel to HTML conversion

Microsoft Excel file may contain many unnecessary unused styles. When you export the Excel file to HTML file format, these unused styles are also exported. This could increase the size of HTML. You can exclude the unused styles during the conversion of Excel file to HTML using the HtmlSaveOptions.ExcludeUnusedStyles property. For more detail on the feature, please see this article/document for your reference.

Export Document, Workbook and Worksheet Properties in Excel to HTML conversion

When Microsoft Excel file is exported to HTML using Microsoft Excel or Aspose.Cells APIs, it also exports various types of Document, Workbook and Worksheet properties. You can avoid exporting these properties by setting the HtmlSaveOptions.ExportDocumentProperties, HtmlSaveOptions.ExportWorkbookProperties and HtmlSaveOptions.ExportWorksheetProperties as false. The default value of these properties is true. For more detail, please see this article.

Find and Refresh the nested or children Pivot Tables of Parent Pivot Table

A Pivot table may use other pivot table as a data source. Such a Pivot table is called a child or nested Pivot table to its parent Pivot table. You can find the children Pivot tables for a parent Pivot table using the PivotTable.GetChildren() method. For more detail, please see this article.

Parse Pivot Cached Records while loading Excel file

When you create a Pivot Table, Microsoft Excel takes a copy of the source data and stores it in the Pivot Cache. The Pivot Cache is held inside the memory of Microsoft Excel. When you load your Excel file inside the Workbook object, you can decide whether you also want to load the records of Pivot Cache or not, using the LoadOptions.ParsingPivotCachedRecords property. The default value of this property is false. If Pivot Cache is quite big, it can increase the performance. For more detail, please see this article.

Handle events after deleting rows and columns in GridDesktop

Aspose.Cells.GridDesktop has introduced two new events i.e. AfterDeleteColumns and AfterDeleteRows. These events are fired when you delete column(s) and row(s) respectively. For more detail, please see this article.

Other Enhancements and Fixes

There are some other enhancements included and a few exception handled in the new release for the users. A few of the worth mentioning features and other enhancements are as follows.

In Aspose.Cells 18.1, we fixed several important bugs and other issues. For example, issues around reading/writing MS Excel file formats, manipulating Ole Objects in Excel file, rendering Excel to HTML and vice versa, converting SpreadsheetML to XLSX,  import custom objects to Excel sheet, rendering and manipulating charts, manipulating PivotTables, rendering images from Excel worksheets, rendering images files from charts and exporting Excel workbooks to PDF format have been resolved. Moreover, the Aspose.Cells formula calculation engine is also optimized.

Changes to the Public API

This version of Aspose.Cells for .NET has made some changes to the Public API. A few of the worth mentioning changes are as follow:

  • Added LoadOptions.ParsingPivotCachedRecords property, it indicates whether parsing pivot cached records when loading the file. The default value is false.
  • Added HtmlSaveOptions.ExcludeUnusedStyles property, it indicates whether excluding unused styles.The default value is false.
  • Added HtmlSaveOptions.ExportDocumentProperties property, it indicates whether exporting document properties.The default value is true.
  • Added HtmlSaveOptions.ExportWorksheetProperties property, it indicates whether exporting worksheet properties.The default value is true.
  • Added PivotTable.GetChildren() method, it gets the the children Pivot Tables which use this PivotTable data as data source.

    Aspose.Cells for .NET Resources

    The resources, you may need to accomplish your tasks: