Public API Changes in Aspose.Cells 8.8.0

Added APIs

Get Cell References for External Connection

Aspose.Cells for .NET 8.8.0 has exposed the following new properties that are helpful in retrieving the target and output cell references for external connections stored in the spreadsheet.

  1. QueryTable.ConnectionId: Gets the connection Id of the query table.
  2. ExternalConnection.Id: Gets the Id of the external connection.
  3. ListObject.QueryTable: Gets the linked QueryTable.

Added HTMLLoadOptions.KeepPrecision Property

Aspose.Cells for .NET 8.8.0 has added the HTMLLoadOptions.KeepPrecision property in order to control the conversion of long numeric values to exponential notation while importing HTML files. By default, any value longer than 15 digits gets converted to exponential notation if the data is being imported from an HTML string or file. However, users can now control this behavior with the help of the HTMLLoadOptions.KeepPrecision property. If the property is set to true, the values will be imported exactly as they appear in the source.

Following is a simple usage scenario.

C#

string html = @"
<table data-cache=""not-cached"" class=""sortable"">
   <tbody>
    <tr>
     <td class=""even"">9999999999999999</td>
     <td class=""odd"">10.8%</td>
    </tr>
   </tbody>
</table>
";

byte[] byteArray = Encoding.UTF8.GetBytes(html);

HTMLLoadOptions loadOptions = new Aspose.Cells.HTMLLoadOptions(LoadFormat.Html);
loadOptions.KeepPrecision = true;

MemoryStream stream = new MemoryStream(byteArray);
Workbook workbook = new Workbook(stream, loadOptions);
Worksheet sheet = workbook.Worksheets[0];
sheet.AutoFitColumns();

workbook.Save(dir + "output.xlsx");

Added HTMLLoadOptions.DeleteRedundantSpaces Property

Aspose.Cells for .NET 8.8.0 has exposed the HTMLLoadOptions.DeleteRedundantSpaces property in order to retain or delete the extra spaces after the line‑break tag (<br> tag) while importing data from an HTML string or file. The property’s default value is false, which means all extra spaces will be preserved and imported to the Workbook object. When set to true, the API will delete all redundant spaces that come after the line‑break tag.

A simple usage scenario looks as follows.

C#

string html = @"
<html>
    <body>
        <table>
            <tr>
                <td>
                    <br>    This is sample data 
                    <br>    This is sample data
                    <br>    This is sample data
                </td>
            </tr>
        </table>
    </body>
</html>
";

byte[] byteArray = Encoding.UTF8.GetBytes(html);

HTMLLoadOptions loadOptions = new Aspose.Cells.HTMLLoadOptions(LoadFormat.Html);
loadOptions.DeleteRedundantSpaces = true;

MemoryStream stream = new MemoryStream(byteArray);
Workbook workbook = new Workbook(stream, loadOptions);
workbook.Save(dir + "output.xlsx");

Added Style.QuotePrefix Property

Aspose.Cells for .NET 8.8.0 has exposed the Style.QuotePrefix property in order to detect if a cell value starts with a single‑quote symbol.

A simple usage scenario looks as follows.

C#

Workbook book = new Workbook();
Worksheet sheet = book.Worksheets[0];
Cell a1 = sheet.Cells["A1"];
Cell a2 = sheet.Cells["A2"];

a1.PutValue("sample");
a2.PutValue("'sample");

Console.WriteLine("String value of A1: " + a1.StringValue);
Console.WriteLine("String value of A2: " + a2.StringValue);

Style s1 = a1.GetStyle();
Style s2 = a2.GetStyle();

Console.WriteLine("A1 has a quote prefix: " + s1.QuotePrefix);
Console.WriteLine("A2 has a quote prefix: " + s2.QuotePrefix);

Obsoleted APIs

Obsoleted LoadOptions.ConvertNumericData Property

Aspose.Cells 8.8.0 has marked the LoadOptions.ConvertNumericData property as obsolete. Please use the corresponding property from the HTMLLoadOptions or TxtLoadOptions classes.