回复 5楼xujingtian的帖子
表头分别指 ColumnHeader 和 RowHeader,如果你的模板固定(这也是一个限制),我觉得是可行的:
1.行列头本身是固定的不随着表单滚动离开视图区。
2.可以进行合并等操作。
你只需要做一下样式的设置模拟普通单元格即可。
- FpSpread1.Sheets[0].ColumnCount = 8;
-
- FpSpread1.Sheets[0].RowCount = 8;
-
- // Set the number or rows and columns in the headers.
-
- FpSpread1.Sheets[0].ColumnHeader.RowCount = 3;
-
- FpSpread1.Sheets[0].RowHeader.ColumnCount = 2;
-
-
-
- // Span the header cells as needed.
-
- FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(0, 0, 1, 8);
-
- FpSpread1.Sheets[0].RowHeaderSpanModel.Add(0,0,12,1);
-
-
-
- FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(1, 0, 1, 2);
-
- FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(1, 2, 1, 2);
-
- FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(1, 4, 1, 2);
-
- FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(1, 6, 1, 2);
-
- FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(1, 8, 1, 2);
-
-
-
- // Set the labels as needed --
- // using the Label property or the cell Text property.
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Text = "Fiscal Year 2005";
-
- FpSpread1.Sheets[0].RowHeader.Cells[0, 0].Text = "Branch #";
-
-
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[1, 0].Text = "1st Quarter";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[1, 2].Text = "2nd Quarter";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[1, 4].Text = "3rd Quarter";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[1, 6].Text = "4th Quarter";
-
-
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[2, 0].Text = "East";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[2, 1].Text = "West";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[2, 2].Text = "East";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[2, 3].Text = "West";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[2, 4].Text = "East";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[2, 5].Text = "West";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[2, 6].Text = "East";
-
- FpSpread1.Sheets[0].ColumnHeader.Cells[2, 7].Text = "West";
复制代码 |