Auto Print Report From Customization

I hope this code will help you.

                Ice.Core.Session otSession = (Ice.Core.Session)this.oTrans.Session;
		String strWorkstationID = Ice.Lib.Report.EpiReportFunctions.GetWorkStationID(otSession);

		Erp.Proxy.Rpt.BOLFormImpl report = 
                WCFServiceSupport.CreateImpl<Erp.Proxy.Rpt.BOLFormImpl>(otSession, 
                Epicor.ServiceModel.Channels.ImplBase<Erp.Contracts.BOLFormSvcContract>.UriPath);
		Erp.Rpt.BOLFormDataSet ds = report.GetNewParameters();
		
		ds.BOLFormParam[0].BOLNum = 1;
		ds.BOLFormParam[0].AutoAction = "SSRSPREVIEW";
		ds.BOLFormParam[0].AgentSchedNum = 0;
		ds.BOLFormParam[0].AgentID = "SystemTaskAgent";
		ds.BOLFormParam[0].AgentTaskNum = 0;
		ds.BOLFormParam[0].RecurringTask = false;
		ds.BOLFormParam[0].RptPageSettings = "";
		ds.BOLFormParam[0].RptPrinterSettings = "";
		ds.BOLFormParam[0].RptVersion = "";
		ds.BOLFormParam[0].ReportStyleNum = 2;
		ds.BOLFormParam[0].WorkstationID = strWorkstationID;
		ds.BOLFormParam[0].TaskNote = "";
		ds.BOLFormParam[0].ArchiveCode = 0;
		ds.BOLFormParam[0].DateFormat = "mm/dd/yyyy";
		ds.BOLFormParam[0].NumericFormat = ",.";
		ds.BOLFormParam[0].AgentCompareString = "";
		ds.BOLFormParam[0].ProcessID = "";
		ds.BOLFormParam[0].ProcessTaskNum = 0;
		ds.BOLFormParam[0].DecimalsPrice = 0;
		ds.BOLFormParam[0].GlbDecimalsGeneral = 0;
		ds.BOLFormParam[0].GlbDecimalsCost = 0;
		ds.BOLFormParam[0].GlbDecimalsPrice = 0;				
		ds.BOLFormParam[0].SSRSRenderFormat = "PDF";

		report.RunDirect(ds);
3 Likes