问题描述
我正在尝试在自定义尺寸的纸张上打印,但是打印机没有选择打印机的默认设置,因此在打印过程中纸张为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.
推荐答案
这篇关于在运行时为Crystal Reports设置纸张大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!