AccpacReport rpt = Program.session.ReportSelect("OEINV01[C://SAGE//Sage ERP 300//OE61A//ENG//GST-CHUANLEEHININVNEW3B.RPT]", " ", " ");
AccpacPrintSetup rptPrintSetup = Program.session.GetPrintSetup(" ", " "); // the record show error AccpacPrintSetup is not available when accessing a remote Sage 300 ERP server
rptPrintSetup.DeviceName = "FX DC-II C4300 PCL";
rptPrintSetup.OutputName = "192.168.1.160_1";
rptPrintSetup.Orientation = 1;
rptPrintSetup.PaperSize = 9;
rptPrintSetup.PaperSource = 15;
rpt.PrinterSetup(rptPrintSetup);
rpt.SetParam("PRINTED", "1");
rpt.SetParam("DELMETHOD", "1");
rpt.SetParam("ECENABLED", "0");
rpt.SetParam("DIRECTEC", "0");
rpt.SetParam("QTYDEC", "4");
rpt.SetParam("BOITEM", "1");
rpt.SetParam("SORTFROM", invoiceNum);
rpt.SetParam("SORTTO", invoiceNum);
rpt.SetParam("SWDELMETHOD", "3");
rpt.SetParam("SERIALLOTNUMBERS", "0");
rpt.SetParam("PRINTKIT", "0");
rpt.SetParam("PRINTBOM", "0");
rpt.SetParam("RETAINAGE", "0");
rpt.SetParam("@SELECTION_CRITERIA", "(({OEINVH.INVNUMBER} >= '" + invoiceNum + "') AND ({OEINVH.INVNUMBER} <= '" + invoiceNum + "'))");
rpt.NumOfCopies = 1;
rpt.Destination = tagPrintDestinationEnum.PD_PREVIEW;
rpt.PrintDir = "";
rpt.PrintReport();
237

260
