Hi Amjad Sahi,
Hi,
Hi Amjad Sahi,
|
Hi,
Sample code:
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
string cellValue1 = ““Barclays Capital Inc.” and “Barclays US Floating Rate Note < 5 Years Index” are trademarks of Barclays Bank PLC and have been licensed for use for certain purposes by BlackRock Institutional Trust Company, N.A. (“BTC”). iShares® is a registered trademark of BTC.”;
Aspose.Cells.Cell cellA1 = worksheet.Cells[“A1”];
cellA1.HtmlString = System.Web.HttpUtility.HtmlDecode( cellValue1 );
workbook.Save(“C:\temp\result1.xls”);
It throws below error:
"[ArgumentException: Item has already been added. Key in dictionary: ‘FOR’ Key being added: ‘FOR’] "
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
string cellValue2 = “one is < two”;
Aspose.Cells.Cell cellA2 = worksheet.Cells[“A2”];
cellA2.HtmlString = System.Web.HttpUtility.HtmlDecode( cellValue2 );
workbook.Save(“C:\temp\result2.xls”);
Hi,
We have fixed this issue.
Please download and try this fix: Aspose.Cells for .NET v7.3.1.5 and let us know your feedback.
Below is the sample code.
C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
string cellValue2 = “one is < two”;
Aspose.Cells.Cell cellA2 = worksheet.Cells[“A2”];
cellA2.HtmlString = System.Web.HttpUtility.HtmlEncode( cellValue2 );
workbook.Save(“C:\temp\result2.xls”);
Hi Shakeel Faiz,
Hi,
Hi,
Thanks for your posting and using Aspose.Cells.
Please use the following code.
C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
string cellValue1 = ““Barclays Capital Inc.” and “Barclays US Floating Rate Note < 5 Years Index” are trademarks of Barclays Bank PLC and have been licensed for use for certain purposes by BlackRock Institutional Trust Company, N.A. (“BTC”). iShares® is a registered trademark of BTC.”;
string cellValue2 = “one is < two”;
Aspose.Cells.Cell cellA1 = worksheet.Cells[“A1”];
Aspose.Cells.Cell cellA2 = worksheet.Cells[“A2”];
cellA1.HtmlString = cellValue1;//cellvalue1 has been encoded.
cellA2.HtmlString = System.Web.HttpUtility.HtmlEncode(cellValue2);
workbook.Save(“d:\filetemp\dest.xls”);
Hi Shakeel Faiz,
Hi Lakshmi,
Hi,
Thanks for your posting and using Aspose.Cells.
If you want input < as the cell value not html tag, please encode it as “<”
If we get ‘<’ when parsing html string and can get ‘>’ after ‘>’, we think it’s not standard html string and can process it fine.
And we did the following tests in IE with a simple html file:
a)If " one is < two " is input, " one is < two " is displayed.
b)If " one is <two " is input, " one is " is displayed.
We found if a space is followed by < , it should be process as html tag. We will fix this issue soon.
But we still hope you can input standard html string value to ignore unknown issues.
Hi,
Hi,
You are welcome.
We will keep looking into your mentioned issue. Once we will have some update/advice for you, we will get back to you asap.
Also, if you face any other issue relating to Aspose.Cells, please let us know, we will be glad to assist you.
Hi,
I have downloaded the version specified for Aspose.cell in the thread. But I am getting Index out of range. Did you guys changed anything in the specified version in thread.. ? As previously I downloaded the dll from this thread it was working fine, and Now I am getting "Index out of Range Error " while setting the value for cell.HtmlString..
Thanks.
Hi,
cell.HtmlString is "<Font Style="FONT-WEIGHT: bold;FONT-FAMILY: Arial;FONT-SIZE: 10pt;COLOR: #000000;">Less Fee Waivers & Net Expenses Footnote</Font> "<div><br></div><div>cell.StringValue :- Less Fee Waivers & Net Expenses Footnote.</div><div><br></div><div> cell.HtmlString = cell.StringValue; this line is throwing the error Index out of range. </div><div><br></div>
This is happening for me whenever there is “&” symbol in the cell.StringValue
Hi,
Sample code:
Workbook workbook = new Workbook();
Worksheet worksheet1 = workbook.Worksheets[0];
Cells cells = worksheet1.Cells;
Aspose.Cells.Cell cell = cells[“A1”];
string val = “Less Fee Waivers & Net Expenses Footnote.”;
cell.HtmlString = val; // error
workbook.Save(“e:\test2\outputcellstring.xlsx”);
Hi,
Thanks for your posting and using Aspose.Cells for .NET.
Please download and try this fix: Aspose.Cells for .NET v7.4.0.4 and let us know your feedback.