找回密码
 立即注册

QQ登录

只需一步,快速开始

ccc_ooo

高级会员

29

主题

61

帖子

1108

积分

高级会员

积分
1108

活字格认证

最新发帖
ccc_ooo
高级会员   /  发表于:2011-11-4 09:34  /   查看:5169  /  回复:5
中间第二列不打印,怎么设置?

5 个回复

正序浏览
iceman
社区贡献组   /  发表于:2011-11-11 14:50:00
6#
你好,我测试隐藏第二列,没有重现你的问题。
测试代码:
  1. private void Form1_Load(object sender, EventArgs e)
  2.         {
  3.             FarPoint.Win.Spread.GridLine HGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Flat, Color.Red);
  4.             FarPoint.Win.Spread.GridLine VGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Flat, Color.Chartreuse);
  5.             this.fpSpread1.Sheets[0].HorizontalGridLine = HGridLine;
  6.             this.fpSpread1.Sheets[0].VerticalGridLine = VGridLine;

  7.             this.fpSpread1.PrintSheet(this.fpSpread1.ActiveSheet);
  8.         }

  9.         private void fpSpread1_PrintMessageBox(object sender, FarPoint.Win.Spread.PrintMessageBoxEventArgs e)
  10.         {     
  11.             if (e.BeginPrinting)
  12.             {
  13.                 this.fpSpread1.ActiveSheet.Columns[1].Visible = false;
  14.             }
  15.             else
  16.             {
  17.                 this.fpSpread1.ActiveSheet.Columns[1].Visible = true;      
  18.             }
  19.         }
复制代码
效果图:

png

png

请你参考代码进行设置,如果仍不能解决问题,请制作 Demo 上传到论坛,便于确定问题。
回复 使用道具 举报
ccc_ooo
高级会员   /  发表于:2011-11-11 14:26:00
5#
你试一下第二列
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2011-11-9 18:44:00
地板
你好,我这里没有重现你的问题,效果图:

png

png

请问你的边框或网格线是怎样设置的?麻烦把你的 Spread 设置代码片段贴出来。
回复 使用道具 举报
ccc_ooo
高级会员   /  发表于:2011-11-9 16:27:00
板凳
设置后打印预览表格从第二列断裂,表格不连续,怎么解决?
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2011-11-4 10:17:00
沙发

回复 1# ccc_ooo 的帖子

你好,可以使用  PrintMessageBox 事件实现该功能,在打印开始时隐藏特定列,从而不打印该列,在打印结束后重新显示该列,设置方法如下:

  1. private void fpSpread1_PrintMessageBox(object sender, FarPoint.Win.Spread.PrintMessageBoxEventArgs e)
  2.         {
  3.             if (e.BeginPrinting==true)
  4.             {
  5.                 this.fpSpread1.ActiveSheet.Columns[0].Visible = false;
  6.             }
  7.             else
  8.             {
  9.                 this.fpSpread1.ActiveSheet.Columns[0].Visible = true;      
  10.             }
  11.         }
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部