I am using Aspose.Cells version 7.0.2.0. It appears the the smart marker does not convert an String value from a .Net DataTable to numeric value in Excel when I use the decorator, “numeric”. An older version of Aspose.Cells that I was using does not have this problem.
For example, if I add a column to a DataTable
dataTable.columns.add(“testColumn”)
dim newRow as DataRow = dataTable.newRow()
newRow(“testColumn”) = 0.25
and then use the following smartMarker: in my Excel template:
&=dataTable.testColumn(numeric)
The value, 0.25, does not show up as numeric in Excel.
The numeric decorator is a very useful feature. Because we often we have to “N/A” and numbers or percentages in a data column.
Hi,
I am not sure if I misunderstand something here.
I downloaded your attached file, outNum_SmartMarkers_result.xlsx. In sheet1, Cell A1, I DO see 0.25 with a little green triangle on the upper left corner. When I format the column A to percentage, the cell value remain to show 0.25 and not a % I think because it is not numeric. Do you really not see the little green triangle ???
Would you download the file from this forum and double check?
Thanks very much.
Hi,
I can see the problem (green triangle) using Ms-Excel 2010 and 2007. I think, it is a bug of Aspose.Cells.
We will look into it and fix it asap.
I have tested it using the latest version:
Aspose.Cells for .NET v7.0.2
Below is my sample code for a reference and the output file.
This issue has been logged as CELLSNET-40019.
C#
string filePath = @“F:\Shak-Data-RW\Downloads\Num_SmartMarkers.xlsx”;
DataTable dt = new DataTable(“dataTable”);
dt.Columns.Add(“testColumn”);
dt.Rows.Add(“0.25”);
WorkbookDesigner designer = new WorkbookDesigner();
Workbook workbook = new Workbook(filePath);
designer.Workbook = workbook;
designer.SetDataSource(dt);
designer.Process(true);
workbook.Save(filePath + “.out.xlsx”);