找回密码
 立即注册

QQ登录

只需一步,快速开始

burns

初级会员

24

主题

54

帖子

498

积分

初级会员

积分
498

活字格认证

burns
初级会员   /  发表于:2016-9-4 01:30  /   查看:3053  /  回复:1
如题,有几个Spread,内容都不同,如第一个表单中的总页数为6,则如何设置第二个表单的页码从7开始,依此类推。

1 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-9-5 11:19:49
沙发
这个没有现成的方法。您可以调用OwnerPrintDraw 方法,然后自定义打印。
  1. private System.Drawing.Printing.PrintDocument pd;
  2. this.pd = new System.Drawing.Printing.PrintDocument();
  3. this.pd.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.pd_PrintPage);

  4. private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs ev)
  5. {
  6.      Rectangle rect = new Rectangle(ev.PageBounds.X, ev.PageBounds.Y, ev.PageBounds.Width/2, ev.PageBounds.Height/2);
  7.      int cnt = fpSpread1.GetOwnerPrintPageCount(ev.Graphics, rect, 0);
  8.      fpSpread1.OwnerPrintDraw(ev.Graphics, rect, 0, cnt);
  9.      ev.Graphics.DrawString("End of Print Job", new Font("MS Sans Serif", 10), new SolidBrush(Color.Black), new Rectangle(ev.PageBounds.X,
  10. ev.PageBounds.Y + ev.PageBounds.Height/2, ev.PageBounds.Width/2, ev.PageBounds.Height/2));
  11.      ev.HasMorePages = false;
  12. }
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部