I have been spinning my wheels on this and hope someone might have advice to assist. Long story short, I have an invoice group of about 1000 invoices and it is not an option to create smaller groups. I have been tasked with breaking the group apart into smaller print jobs to increase the speed of output. I have been able to break apart the invoice group using the code below but it appears that the system is attempting to process them too quickly because the majority of them do not print. Here is the code if someone can help out:
private void btnPrintGroup_ToolClick(object sender, ToolClickEventArgs e)
{
EpiDataView myv = (EpiDataView)oTrans.EpiDataViews["InvcHeadList"];
var session = (Ice.Core.Session)oTrans.Session;
int totrows = 0;
List<int> myinvoice = new List<int>();
foreach (DataRow r in myv.dataView.Table.Rows)
{
myinvoice.Add(Convert.ToInt32(r["InvoiceNum"]));
totrows = totrows + 1;
}
int rownum = 0;
foreach (int invoiceNum in myinvoice)
{
rownum = rownum + 1;
oTrans.PushStatusText(string.Format("Outputting Invoice {0}/{1}", rownum, totrows), true);
using (var svc = WCFServiceSupport.CreateImpl<Erp.Proxy.Rpt.ARInvFormImpl>(session, Epicor.ServiceModel.Channels.ImplBase<Erp.Contracts.ARInvFormSvcContract>.UriPath))
{
Erp.Rpt.ARInvFormDataSet ds = svc.GetNewParameters();
//System.Threading.Thread.Sleep(1000);
ds.ARInvFormParam[0].InvoiceNum = invoiceNum;
ds.ARInvFormParam[0].PrintNPost = false;
ds.ARInvFormParam[0].Vouchering = false;
ds.ARInvFormParam[0].AssignLegalNumber = false;
ds.ARInvFormParam[0].AutoAction = "SSRSPrint";
ds.ARInvFormParam[0].ReportStyleNum = 1004;
ds.ARInvFormParam[0].WorkstationID = Environment.MachineName + " " + session.GetTerminalID().ToString();
ds.ARInvFormParam[0].RptPageSettings = @"Color=False,Landscape=False,Margins=[Left=100 Right=100 Top=100 Bottom=0],PaperSize=[Kind=""Custom"" PaperName=""Letter"" Height=1100 Width=850],PaperSource=[SourceName=""FormSource"" Kind=""Custom""],PrinterResolution=[Kind=""Custom"" X=600 Y=600]";
ds.ARInvFormParam[0].RptPrinterSettings = @"PrinterName=""\\192.168.1.13\Epicor APM Printer"",Copies=1,Collate=False,Duplex=Default,FromPage=1,ToPage=0";
ds.ARInvFormParam[0].PrinterName = @"\\192.168.1.13\Epicor APM Printer";
ds.ARInvFormParam[0].SSRSRenderFormat = "EMF";
ds.ARInvFormParam[0].AttachmentType = "PDF";
ds.ARInvFormParam[0].ReportCurrencyCode = @"USD";
ds.ARInvFormParam[0].ReportCultureCode = @"en-US";
ds.ARInvFormParam[0].DateFormat = @"m/d/yyyy";
ds.ARInvFormParam[0].NumericFormat = @",.";
svc.SubmitToAgent(ds, "systemagent", 12345, 0, "Erp.UIRpt.ARInvForm");
}
oTrans.PopStatus();
}
// oTrans.PushStatusText(âReadyâ, false);
MessageBox.Show(string.Format(âSubmitted {0} Invoices to Task Agentâ, totrows));
}