C1Report 定制页面大小
C1Report 允许我们安装需求创建和打印 Report , Report 默认纸张大小为 A4 ,但是经常会出现打印机中的值张大小不是 A4 的情况
这篇文章将详细讲述“定制纸张大小”。
一、 定制值张大小
a) 设置 C1Report.Document 下属性DefaultPageSettings.PaperSize 。
b) 设置 “Layout.Papersize” 属性。
C1Report 设置
以下步骤描述定制 C1Report 的 PaperSize 属性
a) 设置 C1Report 下属性 “Layout.PaperSize”属性为 “PaperKind.Custom”
b) 设置 C1Report 下属性 “Layout.CustomHeight“ 和 ”Layout.CustomWidth“
代码参考:
C1Report1.Layout.PaperSize = PaperKind.Custom C1Report1.Layout.CustomHeight = " " C1Report1.Layout.CustomWidth = " " 复制代码
设置C1Report Document:
以下步骤设置 PrintDocument 纸张大小
a) 创建 PrintDocument 实例,并且赋值为 C1Report.Document
b) 创建 PaperSize 实例
c) 设置 DefaultPageSettings.PaperSize 属性为 Custom Papersize。
代码:
Dim PrintDoc As New PrintDocument Dim cps As New PaperSize PrintDoc = C1Report1.Document cps = New PaperSize("MyCustomPaperSize", "CustomHeight", "CustomWidth") PrintDoc.DefaultPageSettings.PaperSize = cps 复制代码
环境:
C1 Studio for Winows && VS 2010
- Custom_PaperSize_PrintDocument.zip (65.68 K, 下载次数:27)