找回密码
 立即注册

QQ登录

只需一步,快速开始

nicvscs

高级会员

7

主题

32

帖子

1853

积分

高级会员

积分
1853

活字格认证

最新发帖

[已处理] 打印空白

nicvscs
高级会员   /  发表于:2015-10-12 17:27  /   查看:8356  /  回复:12
使用js代码打印farpoint的表格, spread.Print();打印出来以后是空白的,只有页码。是哪里的问题啊

12 个回复

正序浏览
iceman
社区贡献组   /  发表于:2015-10-14 11:31:00
13#
回复 11楼nicvscs的帖子

打印页眉页脚设置请通过以下代码实现:
  1.         protected override void Render(HtmlTextWriter writer)
  2.         {
  3.             Control vp;
  4.             LiteralControl header;
  5.             LiteralControl footer;
  6.             if (FpSpread1.IsPrint)
  7.             {
  8.                 vp = this.Controls[2].Controls[1].Controls[0];
  9.                 //The Viewport consits of three children
  10.                 //Controls(0) is a LiteralControl and holds the sheet name for text
  11.                 //Controls(1) is a Table and is the downlevel Spread control
  12.                 //Controls(2) is another LiteralControl to force some more line breaks.
  13.                 header = ((LiteralControl)(vp.Controls[0]));
  14.                 header.Text = "<DIV ALIGN=center>页头设置测试</DIV><BR>";
  15.                 footer = ((LiteralControl)(vp.Controls[2]));
  16.                 footer.Text = "<BR><DIV>页脚设置测试</DIV><BR><BR>";
  17.             }
  18.             base.Render(writer);
  19.         }
复制代码
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2015-10-14 11:20:00
12#
回复 10楼nicvscs的帖子

10# 问题可以通过PostBack参数判断是否刷新弹出打印对话框,请参考截图:
2015-10-14_111834.png
回复 使用道具 举报
nicvscs
高级会员   /  发表于:2015-10-13 15:30:00
11#
回复 9楼iceman的帖子

还有一个问题是打印出来的左上角有一个sheet1的标示,怎么去掉啊
回复 使用道具 举报
nicvscs
高级会员   /  发表于:2015-10-13 14:41:00
10#
回复 9楼iceman的帖子

现在可以打印了,问题我也找到了,是因为你们的打印方法回发了页面,现在的问题是我需要使用PrintInfo设置打印,第二个问题是当我打印了一个表格后刷新页面会弹出第二个打印窗口,应该是你们的自动回发影响了,有解决方案吗
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2015-10-13 14:07:00
9#
回复 8楼nicvscs的帖子

Spread 后台没有提供打印方法,由于我现在没有重现你的问题,所以请你发送当前出错页面或者demo到论坛查看。
打印空白的原因我猜测是数据没有保存上。
回复 使用道具 举报
nicvscs
高级会员   /  发表于:2015-10-13 11:06:00
8#
回复 6楼iceman的帖子

现在我后台设置了PrintInfo,调用js的print方法没有效果,有后台的打印方法吗
回复 使用道具 举报
nicvscs
高级会员   /  发表于:2015-10-13 10:49:00
7#
回复 6楼iceman的帖子

除了工具栏和js方法还有别的方法打印吗
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2015-10-13 10:19:00
6#
回复 5楼nicvscs的帖子

您能否留个电话我们沟通下问题?
回复 使用道具 举报
nicvscs
高级会员   /  发表于:2015-10-13 09:19:00
5#
回复 2楼iceman的帖子

好像找到问题了,print会刷新页面啊……
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部