hasokeric
7/11/2016 - 2:25 PM

E10 Report From Any Screen?

           Erp.Proxy.Rpt.SalesOrderAckImpl rptSOAck = WCFServiceSupport.CreateImpl<Erp.Proxy.Rpt.SalesOrderAckImpl>((Session)oTrans.Session,Erp.Proxy.Rpt.SalesOrderAckImpl.UriPath);

            Erp.Rpt.SalesOrderAckDataSet rptDSSOAck =null;
            rptDSSOAck = rptSOAck.GetNewParameters();

            EpiDataView edvCallContextBpmData = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
            System.Data.DataRow edvCallContextBpmDataRow = edvCallContextBpmData.CurrentDataRow;

            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["OrderNum"] = edvCallContextBpmDataRow["ShortChar02"];
            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["OrderList"] = edvCallContextBpmDataRow["ShortChar02"];

            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["AutoAction"] = "SSRSPrint";
            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["PrinterName"] = strPrinter;
            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["RptPageSettings"] = "Color=True,Landscape=False,Margins=[Left=25 Right=0 Top=16 Bottom=16],PaperSize=[Kind="Letter" PaperName="Letter" Height=1100 Width=850],PaperSource=[SourceName="Automatically Select" Kind="FormSource"]";
            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["RptPrinterSettings"] = "PrinterName="" + strPrinter + "",Copies=" + (string)this.numSOAckQty.Text.Trim()  + ",Collate=True" ;

            //Set Task Agent
            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["AgentID"] = strSysAgent;

            //Report Style
                    rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["ReportStyleNum"] = 1004;

            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["WorkStationID"] = Environment.MachineName + " " + userName;
            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["DateFormat"] = "mm/dd/yyyy";
            rptDSSOAck.Tables["SalesOrderAckParam"].Rows[0]["NumericFormat"] = ",.";

            rptSOAck.SubmitToAgent(rptDSSOAck, strSysAgent,0,0,"Erp.UIRpt.SalesOrderAck");