Tag: 对准

为什么将单元格内容设置为左alignment(Aspose Cells)?

我有这个代码,它应该左alignment特定列的内容: Cell memberItemCodeCell = customerWorksheet.Cells[rowToPopulate, MEMBERITEMCODE_COL]; memberItemCodeCell.PutValue(frbdbc.MemberItemCode, true); var micStyle = memberItemCodeCell.GetStyle(); micStyle.Font.Name = fontForSheets; micStyle.Font.Size = 11; micStyle.HorizontalAlignment = TextAlignmentType.Left; micStyle.IsTextWrapped = false; memberItemCodeCell.SetStyle(micStyle, flag); 它有效…有时: 为什么有时会发生右alignment呢? 任何可以被视为int的值(不包含字母字符或破折号)右alignment; 但为什么它不尊重明确的左alignment,无论它是否看起来像一个int? 在所有列特定的代码之后,有一些适用于整行的“常规”格式: CellsFactory cf = new CellsFactory(); Style style4 = cf.CreateStyle(); if (shipVarDbl >= 1.0) // fewer were shipped than were ordered { style4.ForegroundColor = Color.LightGreen; […]