4,818
社区成员
发帖
与我相关
我的任务
分享
ReportDocument aReportDocument = new ReportDocument();
aReportDocument.Load(@Application.StartupPath + "\\裁片细码单ID卡.rpt");
foreach (Table aTable in aReportDocument.Database.Tables)
{
aTable.LogOnInfo.ConnectionInfo.ServerName = "ERP";//数据源名称
aTable.LogOnInfo.ConnectionInfo.DatabaseName = clsSql.数据库名称;
aTable.LogOnInfo.ConnectionInfo.UserID = clsSql.用户名称;//sa
aTable.LogOnInfo.ConnectionInfo.Password = clsSql.用户密码;
aTable.ApplyLogOnInfo(aTable.LogOnInfo);
}
aReportDocument.PrintOptions.PrinterName = "FX DC 250/350/400 ART4 E";
aReportDocument.PrintToPrinter(1, true, 1, 1);
aReportDocument.Dispose(); frmPrint afrmPrint = new frmPrint();
afrmPrint.g_单据类型 = "裁片细码单ID卡";
afrmPrint.g_打印方式 = "打印";
afrmPrint.Show(); View.ReportSource = aReportDocument;
aReportDocument.PrintOptions.PrinterName = "FX DC 250/350/400 ART4 E";
aReportDocument.PrintOptions.PaperSize = PaperSize.PaperA4;
aReportDocument.PrintToPrinter(1, false, 1, 1);