As an expert in Epicor® consulting, we like posting answers to common questions I see on forums. A lot of users want to be able to print reports directly from the entry screes like Order Entry. Below is some sample code on how to print the sales order pick ticket. This will submit the print request and open the report in preview mode.
Here are the steps:
private static void btnPickList_Click(object sender, System.EventArgs args)
{
Epicor.Mfg.Core.Session epiSession = default(Epicor.Mfg.Core.Session);
epiSession = (Epicor.Mfg.Core.Session)SalesOrderForm.Session;
Epicor.Mfg.Rpt.SOPickListReport rptSOPickList = new Epicor.Mfg.Rpt.SOPickListReport(epiSession.ConnectionPool);
Epicor.Mfg.Rpt.SOPickListReportDataSet rptDSSOPickList = rptSOPickList.GetNewParameters();
EpiDataView edvOrderHed = (EpiDataView)oTrans.EpiDataViews[“OrderHed”];
DateTime dtShipBy = default(DateTime);
dtShipBy = Convert.ToDateTime(edvOrderHed.dataView[edvOrderHed.Row][“RequestDate”]);
// You may need a wider date range to include releases out side the ship date on order header
if (DateTime.Compare(DateTime.Today, dtShipBy) > 0) {
rptDSSOPickList.Tables[“SOPickListReportParam”].Rows[0][“FromDate”] = dtShipBy.AddDays(-1);
} else {
rptDSSOPickList.Tables[“SOPickListReportParam”].Rows[0][“ToDate”] = dtShipBy.AddDays(1);
}
rptDSSOPickList.Tables[“SOPickListReportParam”].Rows[0][“OrderList”] = edvOrderHed.dataView[edvOrderHed.Row][“OrderNum”];
rptDSSOPickList.Tables[“SOPickListReportParam”].Rows[0][“AutoAction”] = “Preview”;
//Set this to your task agent id.
rptDSSOPickList.Tables[“SOPickListReportParam”].Rows[0][“AgentID”] = “TaskAgnt”;
//The report style you want to print.
rptDSSOPickList.Tables[“SOPickListReportParam”].Rows[0][“ReportStyleNum”] = 1002;
rptDSSOPickList.Tables[“SOPickListReportParam”].Rows[0][“WorkstationID”] = Environment.MachineName + ” ” + Process.GetCurrentProcess().SessionId.ToString();
rptDSSOPickList.Tables[“SOPickListReportParam”].Rows[0][“DateFormat”] = “mm/dd/yyyy”;
rptDSSOPickList.Tables[“SOPickListReportParam”].Rows[0][“NumericFormat”] = “,.”;
// TaskAgnt is the ID of your task agent.
rptSOPickList.SubmitToAgent(rptDSSOPickList, “TaskAgnt”, 0, 0, “Epicor.Mfg.UIRpt.SOPickListReport”);
MessageBox.Show(“Pick List Print Job Submitted.”);
}
Suggested
Salesforce integration consulting is about more than just finding a partner with experience in integrations.…
Platform: HubSpot Where It Shines: Email marketing - easy to use email lists, automation, and…
Don’t be left behind by neglecting these 2024 manufacturing trends.
With a comprehensive ERP like CloudSuite Industrial (CSI) from Infor, there are countless possibilities for…
An Infor ERP solution isn’t just a temporary fix to today’s issues, it’s an investment…
An Infor ERP can dramatically improve your operations, but with an ERP integration, you can…