找回密码
 立即注册

QQ登录

只需一步,快速开始

lypvc

银牌会员

17

主题

44

帖子

2515

积分

银牌会员

积分
2515

活字格认证

lypvc
银牌会员   /  发表于:2013-7-24 20:29  /   查看:4825  /  回复:1
截图04.jpg (19.07 KB, 下载次数: 509)

1 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2013-7-25 09:02:00
沙发
回复 1楼lypvc的帖子

参考代码如下:

  1. [C#]

  2. // Set the number of rows in the column header.

  3. FpSpread1.ActiveSheet.ColumnHeader.RowCount = 3;

  4. // Set the number of columns in the row header.

  5. FpSpread1.ActiveSheet.RowHeader.ColumnCount = 2;

  6.   

  7. // Define the labels for the spanned column header cells.

  8. FpSpread1.ActiveSheet.ColumnHeader.Cells[2, 0].Text = "East";

  9. FpSpread1.ActiveSheet.ColumnHeader.Cells[2, 1].Text = "West";

  10. FpSpread1.ActiveSheet.ColumnHeader.Cells[2, 2].Text = "East";

  11. FpSpread1.ActiveSheet.ColumnHeader.Cells[2, 3].Text = "West";

  12. FpSpread1.ActiveSheet.ColumnHeader.Cells[2, 4].Text = "East";

  13. FpSpread1.ActiveSheet.ColumnHeader.Cells[2, 5].Text = "West";

  14. FpSpread1.ActiveSheet.ColumnHeader.Cells[2, 6].Text = "East";

  15. FpSpread1.ActiveSheet.ColumnHeader.Cells[2, 7].Text = "West";

  16. FpSpread1.ActiveSheet.ColumnHeader.Cells[1, 0].Text = "1st Quarter";

  17. FpSpread1.ActiveSheet.ColumnHeader.Cells[1, 2].Text = "2nd Quarter";

  18. FpSpread1.ActiveSheet.ColumnHeader.Cells[1, 4].Text = "3rd Quarter";

  19. FpSpread1.ActiveSheet.ColumnHeader.Cells[1, 6].Text = "4th Quarter";

  20. FpSpread1.ActiveSheet.ColumnHeader.Cells[0, 0].Text = "Fiscal Year 2004";

  21.   

  22. // Define the column header cell spans.

  23. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(1, 0, 1, 2);

  24. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(1, 2, 1, 2);

  25. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(1, 4, 1, 2);

  26. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(1, 6, 1, 2);

  27. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(0, 0, 1, 8);

  28.   

  29. // Define the label for the spanned row header cells.

  30. FpSpread1.ActiveSheet.RowHeader.Cells[0,0].Text ="Branch #";

  31.   

  32. // Define the row header cell span.

  33. FpSpread1.ActiveSheet.AddRowHeaderSpanCell(0, 0, 12, 1);

  34. [Visual Basic]

  35. ' Set the number of rows in the column header.

  36. FpSpread1.ActiveSheet.ColumnHeader.RowCount = 3

  37. ' Set the number of columns in the row header.

  38. FpSpread1.ActiveSheet.RowHeader.ColumnCount = 2

  39.   

  40. ' Define the labels for the spanned column header cells.

  41. FpSpread1.ActiveSheet.ColumnHeader.Cells(2, 0).Text = "East"

  42. FpSpread1.ActiveSheet.ColumnHeader.Cells(2, 1).Text = "West"

  43. FpSpread1.ActiveSheet.ColumnHeader.Cells(2, 2).Text = "East"

  44. FpSpread1.ActiveSheet.ColumnHeader.Cells(2, 3).Text = "West"

  45. FpSpread1.ActiveSheet.ColumnHeader.Cells(2, 4).Text = "East"

  46. FpSpread1.ActiveSheet.ColumnHeader.Cells(2, 5).Text = "West"

  47. FpSpread1.ActiveSheet.ColumnHeader.Cells(2, 6).Text = "East"

  48. FpSpread1.ActiveSheet.ColumnHeader.Cells(2, 7).Text = "West"

  49. FpSpread1.ActiveSheet.ColumnHeader.Cells(1, 0).Text = "1st Quarter"

  50. FpSpread1.ActiveSheet.ColumnHeader.Cells(1, 2).Text = "2nd Quarter"

  51. FpSpread1.ActiveSheet.ColumnHeader.Cells(1, 4).Text = "3rd Quarter"

  52. FpSpread1.ActiveSheet.ColumnHeader.Cells(1, 6).Text = "4th Quarter"

  53. FpSpread1.ActiveSheet.ColumnHeader.Cells(0, 0).Text = "Fiscal Year 2004"

  54.   

  55. ' Define the column header cell spans.

  56. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(1, 0, 1, 2)

  57. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(1, 2, 1, 2)

  58. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(1, 4, 1, 2)

  59. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(1, 6, 1, 2)

  60. FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(0, 0, 1, 8)

  61.   

  62. ' Define the label for the spanned row header cells.

  63. FpSpread1.ActiveSheet.RowHeader.Cells(0,0).Text ="Branch #"

  64.   

  65. ' Define the row header cell span.

  66. FpSpread1.ActiveSheet.AddRowHeaderSpanCell(0, 0, 12, 1)

复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部