【发布时间】:2015-09-22 12:59:16
【问题描述】:
使用 Designer 时,我可以将单元格的 XlsxFormatString 属性编辑为“#,##0.00”,结果符合预期。当我尝试以编程方式执行以下操作时,没有任何改变:
private XRTableCell CreateCell(int width, string text, bool haveColor, string color, bool isBold, DevExpress.XtraPrinting.BorderSide border, bool IsNumeric)
{
//MyWorkaround
if (IsNumeric)
{
if (text.Contains(","))
{
if (text.Length > text.IndexOf(',') + 3)
text = text.Remove(text.IndexOf(',') + 3);
}
}
//MyWorkaround end
XRTableCell cell = CreateCell(width, text, haveColor, color, isBold);
cell.Borders = border;
if (IsNumeric)
cell.XlsxFormatString = "#,##0.00";
return cell;
}
有什么建议可以让它正确吗?
【问题讨论】:
标签: excel import formatting xtrareport