在运行时为Crystal Reports设置纸张大小 [英] Setting Paper Size at runtime for Crystal Reports

查看:106
本文介绍了在运行时为Crystal Reports设置纸张大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试在自定义尺寸的纸张上打印,但是打印机没有选择打印机的默认设置,因此在打印过程中纸张为Letter.我从
创建了一个新表格
从控制面板中打开打印机.
选择点矩阵打印机并将其设置为默认打印机;
保持选中状态,然后单击菜单:文件-服务器属性
检查选项:创建新表单.
给合适的名字说"A6 LR",然后给它的高度和宽度
保存表格

以下是我的代码

Hi,

I am trying to print on a custom sized paper but the printer doesn''t pick the default setting of the printer, therefore during printing the paper is Letter. I have created a new form from

Open Printers from Control Panel.
Select the Dot Matrix Printer and Make it as Default Printer;
Keep it selected and Click on menu : File - Server Properties
Check option : Create New Form.
Give appropriate name say "A6 LR" and Give Height and width
Save the Form

Below is my code

cmd.CommandText = ("SELECT * FROM Sales)
 rptDoc = New CrystalSales
 cmd.Connection = Con
 Con.Open
 DSRpt.Clear()
 DA.SelectCommand = (cmd)
 DA.Fill(DSRpt, cmd.CommandText)
 DTRpt = DSRpt.Tables(0)
 rptDoc.SetDataSource(DTRpt)
 frmRptViewer.Text = "Sales Order Report"
Con.Close
 frmRptViewer.CrystalReportViewer1.ReportSource = rptDoc
 frmRptViewer.ShowDialog()
 frmRptViewer.Dispose()
 rptDoc = Nothing


我需要在打印之前显示报告,因为报告可能超过1页.是否可以通过代码使用打印机默认设置或在运行时更改纸张尺寸?

谢谢您,我们将不胜感激.


I need to show the report before printing because the report can be more than 1 page. Is there a way either through codes I use the printers default setting or change the paper size at runtime?

Thank you and you help will be highly appreciated.

推荐答案

您好
我可以知道您要打印哪种类型的文档.如果是发票或帐单,则无法使用水晶报表.您应该使用文本打印.在此之前,请让我知道您要打印哪种类型的文档.


谢谢与问候
阿伦·瓦苏(Arun Vasu)
喀拉拉邦.
arun.dct@gmail.com
Hi
May i know what type of document you are going to print. If its like Invoice or Bill then you can''t use crystal report. you should use text printing. Before that please let me know what type of document you are going to print.


Thanks and Regards
Arun Vasu
Kerala.
arun.dct@gmail.com


这篇关于在运行时为Crystal Reports设置纸张大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆