Hello
ahmadi_rad@yahoo.com,
Thanks for your inquiry.
Please use the below code to get the border information rather than simply from "style.borders", and you will get the correct result.
- Code: Select all
var workbook = new Workbook();
workbook.LoadFromFile(path);
var worksheet = workbook.Worksheets[0];
bool ifdiaF1 = worksheet.Range["F1"].Borders[BordersLineType.DiagonalDown].ShowDiagonalLine;
bool ifdiaF2 = worksheet.Range["F2"].Borders[BordersLineType.DiagonalUp].ShowDiagonalLine;
//Judge if there's border on the four sides, eg, left.
bool isB1WithLeftborder = false;
var left = worksheet.Range["B1"].Borders[BordersLineType.EdgeLeft];
if (left!=null &&left.LineStyle != LineStyleType.None)
{
isB1WithLeftborder = true;
}
string D1Text = worksheet.Range["D1"].DisplayedText;
In addition, the property "DisplayedText" returns "" at my end. Please check twice or you could add the code snippet at the foremost of the code to try again.
- Code: Select all
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
If the issue still exists, please share your testing environment in detail to help us reproduce the case.
Sincerely,
Jane
E-iceblue support team