[水晶報表]動態設定section高度8/4
来源:互联网 发布:交友软件下载 编辑:程序博客网 时间:2024/05/05 21:08
有一支報表格式如下:
需要採用Letter一半紙張列印,由於每張明細筆數都在2-4之間,而且簽名要顯示在下方,這就需要在代碼中動態設定section(合計區段Section11)的高度,相關代碼如下:
Dim report As New ReportDocument
... ...
Dim sects As Sections=report.ReportDefinition.Sections
Dim sp, sp1 As String
Dim seq As Integer
sp1 = ""
For inta = 0 To dt.Rows.Count - 1
sp = dt.Rows(inta)(0)'群組
If sp1 <> sp And inta > 0 Then
seq = dt.Rows(inta - 1)(5)'明細的最後一筆的序號
Select Case seq
Case 1
sects.Item("Section11").Height = 3632
Case 2
sects.Item("Section11").Height = 3121
Case 3
sects.Item("Section11").Height = 2610
Case 4
sects.Item("Section11").Height = 2099
Case 5
sects.Item("Section11").Height = 1588
Case 6
sects.Item("Section11").Height = 1077
Case Else
sects.Item("Section11").Height = 566
End Select
End If
sp1 = sp
If inta = dt.Rows.Count - 1 Then'對最後一張進行設定
seq = dt.Rows(inta)(5)
Select Case seq
Case 1
sects.Item("Section11").Height = 3632
Case 2
sects.Item("Section11").Height = 3121
Case 3
sects.Item("Section11").Height = 2610
Case 4
sects.Item("Section11").Height = 2099
Case 5
sects.Item("Section11").Height = 1588
Case 6
sects.Item("Section11").Height = 1077
Case Else
sects.Item("Section11").Height = 566
End Select
End If
Next
P.S.高度值是精確計算好的,由於目前對水晶報表自定義紙張的設定在客戶那裏尚未找到支持的方法(在我本機上可以的),所以暫且用一張Letter顯示上面各一半來進行列印,這種情況報表高度計算有個公式:顯示各區段總高度為7269*2+519=15111
注:計算式中的2表示上下2張,519表示在第二張列印時顯示的空白區段
- [水晶報表]動態設定section高度8/4
- 水晶報表Group By時去掉groupby section內的鏈接.
- 水晶報表 主從
- section 和sectionview 的高度
- 水晶報表的制作
- 水晶報表的制作
- 水晶報表部份問題解決
- c# 水晶報表 主從
- C# 水晶報表打印
- 水晶报表的宽度和高度
- 水晶报表表格高度自适应设置方法
- [水晶報表]公式小誤8/10
- 水晶報表打包的具体操作步骤
- 請教VS.NET水晶報表高手~~
- 水晶報表的綁定
- 水晶報表的綁定
- [水晶報表+mysql]MySqlException8/15
- Net水晶報表的使用
- 网络最经典命令行
- 献给学习小偷程序的朋友
- xml解析
- tomcat5.0下配置我的第一个jsp
- 关于JScript 使用说明
- [水晶報表]動態設定section高度8/4
- Hibernate, Java 5 and DAO
- 今天是第一天上班
- MIDP3.0简介
- JDK1.5新特性
- 用java程序将GBK字符转成UTF-8编码格式
- Java Web Start简单入门步骤
- Nokia Series 40 3rd Edition Feature Pack 1 对应的设备
- 扑克发牌算法实现