回复 2楼xiaoyanwei2000的帖子
可以通过自定义单元格类型实现,测试代码:
- Public Class WebForm1
- Inherits System.Web.UI.Page
- Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
- If IsPostBack Then Return
- FpSpread1.ActiveSheetView.Cells(0, 0).CellType = New RotateTextCellType
- FpSpread1.ActiveSheetView.Cells(0, 0).Value = "Test"
- FpSpread1.ActiveSheetView.Rows(0).Height = 100
- FpSpread1.ActiveSheetView.Columns.Default.Width = 24
- FpSpread1.ActiveSheetView.Rows(0).VerticalAlign = VerticalAlign.Top
- End Sub
- End Class
- <Serializable()>
- Public Class RotateTextCellType
- Inherits FarPoint.Web.Spread.LabelCellType
- Public Overrides Function PaintCell(ByVal id As String, ByVal parent As System.Web.UI.WebControls.TableCell, ByVal style As FarPoint.Web.Spread.Appearance, ByVal margin As FarPoint.Web.Spread.Inset, ByVal value As Object, ByVal upperLevel As Boolean) As System.Web.UI.Control
- parent.Style.Add("writing-mode", "tb-rl")
- Return MyBase.PaintCell(id, parent, style, margin, value, upperLevel)
- End Function
- End Class
复制代码 |