找回密码
 立即注册

QQ登录

只需一步,快速开始

sgs

中级会员

74

主题

219

帖子

637

积分

中级会员

积分
637

活字格认证微信认证勋章

sgs
中级会员   /  发表于:2017-4-28 11:09  /   查看:3045  /  回复:4
如题,C1Report想在每页增加一个水印图片,不知道有没有方法。

4 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2017-4-28 14:24:41
沙发
谢谢您的反馈。
为了达到这种效果,需要编码来设计。
基本思路是,先决定页面的个数。
1.在Report.OnOpen的脚本添加如下代码:
  1. CurPageNo = 1
复制代码

2.在Report.OnPage的脚本添加如下代码:
  1. if CurPageNo = Report.Tag then
  2.               Report.Layout.PictureShow = 0
  3.            endif
  4.            CurPageNo = CurPageNo + 1
复制代码

3。生成报表:
  1.   ' load repor template
  2.         Dim rep As C1Report = New C1Report()
  3.         rep.Load("....report.xml", "01: Alternating Background (Greenbar report)")

  4.         ' generate report 1st time to detemine the count of pages
  5.         rep.Render()
  6.         ' store count of pages
  7.         Dim pageCount As Integer = rep.PageImages.Count

  8.         ' set count of pages to tag to allow access from script
  9.         rep.Tag = pageCount

  10.         ' render report again
  11.         rep.Render()

  12.         ' show the report
  13.         Dim dlg As C1PrintPreviewDialog = New C1PrintPreviewDialog()
  14.         dlg.Document = rep
  15.         dlg.ShowDialog()
复制代码


以上代码供您参考。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
sgs
中级会员   /  发表于:2017-5-2 10:08:57
板凳
问题已解决,感谢版主提供思路。
回复 使用道具 举报
JeffryLI
葡萄城公司职员   /  发表于:2017-5-2 10:28:14
地板
能帮助您解决问题是我们的荣幸,祝您工作顺利!
请点击评分,对我5分评价,谢谢!

葡萄城控件服务团队
官方网站: https://www.grapecity.com.cn/developer
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2017-5-2 11:36:48
5#
sgs 发表于 2017-5-2 10:08
问题已解决,感谢版主提供思路。

谢谢您的反馈。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部