回复 11楼nicvscs的帖子
打印页眉页脚设置请通过以下代码实现:- protected override void Render(HtmlTextWriter writer)
- {
- Control vp;
- LiteralControl header;
- LiteralControl footer;
- if (FpSpread1.IsPrint)
- {
- vp = this.Controls[2].Controls[1].Controls[0];
- //The Viewport consits of three children
- //Controls(0) is a LiteralControl and holds the sheet name for text
- //Controls(1) is a Table and is the downlevel Spread control
- //Controls(2) is another LiteralControl to force some more line breaks.
- header = ((LiteralControl)(vp.Controls[0]));
- header.Text = "<DIV ALIGN=center>页头设置测试</DIV><BR>";
- footer = ((LiteralControl)(vp.Controls[2]));
- footer.Text = "<BR><DIV>页脚设置测试</DIV><BR><BR>";
- }
- base.Render(writer);
- }
复制代码 |