ActiveReports2.0中Printer Setting(Width=11904,Height=7086)自定義報表尺寸約為21x12.5cm,預覽正常,邊續紙打印時,打完一頁後會自動多走一空白頁,這是什麼原因?如有高手知道原因,請告知,或告知我你的郵件,我把效果圖發給你幫我分析一下。謝了!真的很急!我已幾天沒做事了!我的Qq:2836567.Email:[email protected]
解决方案 »
- vb怎样向手机发送消息?
- 如何让MDI 窗体内的子窗体居中呢???
- 高手,能否帮忙?谢谢
- 帮我看看下面代码出现"行集不支持反向提取"的提示怎么解决
- 再问高手这个CreateProcess类的调用?
- 高分求助----文件加密问题
- 做数据库开发,请问表格控件用MSFlexGrid还是MSHFlexGrid好呢?他们有什么不同点?
- vb群6537626 才57个人. 大家加啊.不是我创的,是上面的网友
- 在线给分!winsock做服务器端时,代码 tepserver.data "msg",是发给哪个客户端?
- 如何使用Script Control的Run方法?
- pigpag(噼里啪啦)请进!
- 在线等待——请问怎样用VB获得游戏摇杆、手柄的输入信息?
By specifying a DeviceName, reports can be hard coded to use a certain printer. When Setting the DeviceName, use the full path and name for the printer. For example:Private Sub ActiveReport_ReportStart()
Printer.DeviceName = "\\ServerP01\HP LaserJet 5/5M"
End SubThe DeviceName can also be set to a null string. Since ActiveReports uses the default, or specified printer, to base its page and printer settings on, it is highly recommended to set the DeviceName to a null string when the application may run on a system with no default printer attached, such as a web server.
Orientation
A report's orientation can be changed in code by using either of the following syntaxes:Dim lFlag As Boolean
Private Sub ActiveReport_ReportStart()
If lFlag Then
PageSettings.Orientation = ddOLandscape
Else
PageSettings.Orientation = ddOPortrait
End If
End SubAn individual page's orientation can also be set by using a similar call in the PageStart event. For example, the following few lines alternate each page's orientation from portrait to landscape. Private Sub ActiveReport_PageStart()
Static bFlag As Boolean
If bFlag Then
PageSettings.Orientation = ddOPortrait
bFlag = False
Else
PageSettings.Orientation = ddOLandscape
bFlag = True
End If
End SubNote: Using PageSettings.Orientation instead of Printer.Orientation will allow the orientation to be saved as part of the report.PaperSize
The PaperSize property allows a report to be set to a number of pre-defined paper types. Below is a list of pre-defined PaperSize setting:1 Letter, 8 1/2 x 11 in
2 +A611Letter Small, 8 1/2 x 11 in
3 Tabloid, 11 x 17 in
4 Ledger, 17 x 11 in
5 Legal, 8 1/2 x 14 in
6 Statement, 5 1/2 x 8 1/2 in
7 Executive, 7 1/2 x 10 1/2 in
8 A3, 297 x 420 mm
9 A4, 210 x 297 mm
10 A4 Small, 210 x 297 mm
11 A5, 148 x 210 mm
12 B4, 250 x 354 mm
13 B5, 182 x 257 mm
14 Folio, 8 1/2 x 13 in
15 Quarto, 215 x 275 mm
16 10 x 14 in
17 11 x 17 in
18 Note, 8 1/2 x 11 in
19 Envelope #9, 3 7/8 x 8 7/8 in
20 Envelope #10, 4 1/8 x 9 1/2 in
21 Envelope #11, 4 1/2 x 10 3/8 in
22 Envelope #12, 4 1/2 x 11 in
23 Envelope #14, 5 x 11 1/2 in
24 C size sheet
25 D size sheet
26 E size sheet
27 Envelope DL, 110 x 220 mm
29 Envelope C3, 324 x 458 mm
30 Envelope C4, 229 x 324 mm
28 Envelope C5, 162 x 229 mm
31 Envelope C6, 114 x 162 mm
32 Envelope C65, 114 x 229 mm
33 Envelope B4, 250 x 353 mm
34 Envelope B5, 176 x 250 mm
35 Envelope B6, 176 x 125 mm
36 Envelope, 110 x 230 mm
37 Envelope Monarch, 3 7/8 x 7 1/2 in
38 Envelope, 3 5/8 x 6 1/2 in
39 U.S. Standard Fanfold, 14 7/8 x 11 in
40 German Standard Fanfold, 8 1/2 x 12 in
41 German Legal Fanfold, 8 1/2 x 13 in
255 User Defined
Note: A PaperSize can only be used if the selected printer supports the specified size. If the printer does not support the specified PaperSize, the report will use the default PaperSize for the selected printer.To set the paper size in code, use the following syntax in either the ReportStart or PageStart events.Dim pgCounter As IntegerPrivate Sub ActiveReport_PageStart()
pgCounter = pgCounter + 1
If pgCounter > 1 Then
PageSettings.PaperSize = 1 'Letter
End If
End SubPrivate Sub ActiveReport_ReportStart()
PageSettings.PaperSize = 5 'Legal
End SubIn this example, the report's first page is set to legal and every page after is set to letter.
By specifying a PaperSize of 256, a custom PaperSize can be defined. For custom paper sizes, a PaperWidth and PaperHeight value will need to be specified.Private Sub ActiveReport_ReportStart()
PageSettings.PaperSize = 256 'Custom PaperSize
PageSettings.PaperHeight = 6 * 1440 'Six inches
PageSettings.PaperWidth = 6 * 1440 'Six inches
End SubNote: Setting the DeviceName to a null string will allow any PaperSize to be used. However, this will prevent the report from printing since no printer is defined.Margins
A report's margins can also be set in code by using the following: Private Sub ActiveReport_ReportStart()
PageSettings.BottomMargin = 720 '1/2 Inch
PageSettings.TopMargin = 2880 '2 Inches
PageSettings.LeftMargin = 720 '1/2 Inch
PageSettings.RightMargin = 720 '1/2 Inch
End SubNote: Margins are measured in twips, so a 1 inch margin will be equal to 1440 twips.PrintWidth
Modifying the PrintWidth changes the amount of physical space a report can print to. If the report's size changes during run-time, such as changing a report's orientation when the designer is set to 8.5 inches, the PrintWidth will also need to be adjusted. This makes sure the report fills the entire printable area.Private Sub ActiveReport_ReportStart()
PageSettings.Orientation = ddOLandscape
'Sets the new printwidth to be 11 inches
'minus the left an right margins
Me.PrintWidth = 11 * 1440 - (PageSettings.LeftMargin + PageSettings.RightMargin) '11 inches
End SubWarning: Blank Pages or Red Vertical Lines: If the width of the report, plus the left and right margins, is greater than the width of the physical paper, a blank page will be printed between each report page. If a report's size is wider than the page, a vertical, dotted red line will appear on the right side of the page. To correct this problem ensure the sum of .PageLeftMargin + .PrintWidth + .PageRightMargin is less than the width of your paper (Printer.PaperWidth).
ActiveReports1.1中我就遇到这个问题了,所有的打印预览都正常,可是在打印时,会在每一页后加一页空白页,也就是打3页,他会出来6页,3张白的夹中间,郁闷的不得了.还以为我没注册他们整我呢,呵呵.
后来我就只要打 A4我就再打印前再改下打印机的纸的大小到信纸,就好了,不过到现在还没明白是什么一回事.