Acumatica 打印具有封面的报告&;页脚作为处理屏幕中的子报告

Acumatica 打印具有封面的报告&;页脚作为处理屏幕中的子报告,acumatica,Acumatica,我已经创建了一个自定义报告,其中包括一个在报告页眉中称为子报告的求职信和一个在报告页脚中称为摘要报告。当在“操作”菜单中调用以打印单个报告时,此功能可以正常工作 我设计了一个类似于销售订单打印/电子邮件处理的处理屏幕,当打印多个文档时,封面信打印一次,所有选定文档的主报告打印,最后一个文档的摘要报告打印 public PXAction<SOOrder> printreport; [PXUIField(DisplayName = "Print Production R

我已经创建了一个自定义报告,其中包括一个在报告页眉中称为子报告的求职信和一个在报告页脚中称为摘要报告。当在“操作”菜单中调用以打印单个报告时,此功能可以正常工作

我设计了一个类似于销售订单打印/电子邮件处理的处理屏幕,当打印多个文档时,封面信打印一次,所有选定文档的主报告打印,最后一个文档的摘要报告打印

public PXAction<SOOrder> printreport;
    [PXUIField(DisplayName = "Print Production Report", MapEnableRights = PXCacheRights.Select)]
    [PXButton(SpecialType = PXSpecialButtonType.ReportsFolder)]
    protected virtual IEnumerable PrintReport(PXAdapter adapter)
    {
        List<SOOrder> list = adapter.Get<SOOrder>().ToList();
        if (list.Count > 0)
        {
            string reportID = "PS642000";
            Base.Save.Press();
            Dictionary<string, string> parameters = new Dictionary<string, string>();
            string actualReportID = null;

            PXReportRequiredException ex = null;
            Dictionary<PX.SM.PrintSettings, PXReportRequiredException> reportsToPrint = new Dictionary<PX.SM.PrintSettings, PXReportRequiredException>();

            foreach (SOOrder order in list)
            {
                PSSOOrderExtNV extNV = Base.Document.Cache.GetExtension<PSSOOrderExtNV>(order);
                if (extNV.UsrIsScreenPrint != true)
                    continue;
                parameters = new Dictionary<string, string>();
                parameters["SOOrder.OrderType"] = order.OrderType;
                parameters["SOOrder.OrderNbr"] = order.OrderNbr;

                object cstmr = PXSelectorAttribute.Select<SOOrder.customerID>(Base.Document.Cache, order);
                actualReportID = new NotificationUtility(Base).SearchReport(SONotificationSource.Customer, cstmr, reportID, order.BranchID);
                ex = PXReportRequiredException.CombineReport(ex, actualReportID, parameters);

                reportsToPrint = PX.SM.SMPrintJobMaint.AssignPrintJobToPrinter(reportsToPrint, parameters, adapter, new NotificationUtility(Base).SearchPrinter, SONotificationSource.Customer, reportID, actualReportID, order.BranchID);
            }

            if (ex != null)
            {
                PX.SM.SMPrintJobMaint.CreatePrintJobGroups(reportsToPrint);

                throw ex;
            }
        }
公共行动打印报告;
[PXUIField(DisplayName=“打印生产报告”,MapEnableRights=PXCacheRights.Select)]
[PXButton(SpecialType=PXSpecialButtonType.ReportsFolder)]
受保护的虚拟IEnumerable打印报告(PXAdapter)
{
List=adapter.Get().ToList();
如果(list.Count>0)
{
string reportID=“PS642000”;
Base.Save.Press();
字典参数=新字典();
字符串actualReportID=null;
PXReportRequiredException ex=null;
Dictionary reportsToPrint=新字典();
foreach(按列表中的顺序排序)
{
PSSOOrderExtNV extNV=Base.Document.Cache.GetExtension(订单);
如果(extNV.UsrIsScreenPrint!=真)
继续;
参数=新字典();
参数[“SOOrder.OrderType”]=order.OrderType;
参数[“SOOrder.OrderNbr”]=order.OrderNbr;
对象cstmr=PXSelectorAttribute.Select(Base.Document.Cache,order);
actualReportID=new NotificationUtility(Base).SearchReport(SONotificationSource.Customer,cstmr,reportID,order.BranchID);
ex=PXReportRequiredException.CombineReport(ex,actualReportID,参数);
reportsToPrint=PX.SM.SMPrintJobMaint.AssignPrintJobToPrinter(reportsToPrint、参数、适配器、新通知实用程序(基本)。SearchPrinter、SONotificationSource.Customer、reportID、actualReportID、order.BranchID);
}
如果(ex!=null)
{
PX.SM.SMPrintJobMaint.CreatePrintJobGroups(ReportStopPrint);
掷骰子;
}
}

如何解决此问题?

我尝试过,但没有成功。现在我已删除子报表,并按顺序分别执行以归档所需结果

    public PXAction<SOOrder> screenprintreport;
    [PXUIField(DisplayName = "Screen Print Production Report", MapEnableRights = PXCacheRights.Select)]
    [PXButton(SpecialType = PXSpecialButtonType.ReportsFolder)]
    protected virtual IEnumerable screenPrintReport(PXAdapter adapter)
    {
        List<SOOrder> list = adapter.Get<SOOrder>().ToList();
        if (list.Count > 0)
        {
            string creportID = "SO641010";
            string reportID = "PS642000";
            Base.Save.Press();
            Dictionary<string, string> parameters = new Dictionary<string, string>();
            string actualReportID = null;

            PXReportRequiredException ex = null;
            Dictionary<PX.SM.PrintSettings, PXReportRequiredException> reportsToPrint = new Dictionary<PX.SM.PrintSettings, PXReportRequiredException>();

            foreach (SOOrder order in list)
            {
                PSSOOrderExtNV extNV = Base.Document.Cache.GetExtension<PSSOOrderExtNV>(order);
                if (extNV.UsrIsScreenPrint != true)
                    continue;
                parameters = new Dictionary<string, string>();
                parameters["SOOrder.OrderType"] = order.OrderType;
                parameters["SOOrder.OrderNbr"] = order.OrderNbr;

                object cstmr = PXSelectorAttribute.Select<SOOrder.customerID>(Base.Document.Cache, order);
                actualReportID = new NotificationUtility(Base).SearchReport(SONotificationSource.Customer, cstmr, creportID, order.BranchID);
                ex = PXReportRequiredException.CombineReport(ex, actualReportID, parameters);

                reportsToPrint = PX.SM.SMPrintJobMaint.AssignPrintJobToPrinter(reportsToPrint, parameters, adapter, new NotificationUtility(Base).SearchPrinter, SONotificationSource.Customer, creportID, actualReportID, order.BranchID);
                actualReportID = null;
                actualReportID = new NotificationUtility(Base).SearchReport(SONotificationSource.Customer, cstmr, reportID, order.BranchID);
                ex = PXReportRequiredException.CombineReport(ex, actualReportID, parameters);

                reportsToPrint = PX.SM.SMPrintJobMaint.AssignPrintJobToPrinter(reportsToPrint, parameters, adapter, new NotificationUtility(Base).SearchPrinter, SONotificationSource.Customer, reportID, actualReportID, order.BranchID);


            }

            if (ex != null)
            {
                PX.SM.SMPrintJobMaint.CreatePrintJobGroups(reportsToPrint);

                throw ex;
            }
        }
    }
公共PXAction屏幕打印报告;
[PXUIField(DisplayName=“屏幕打印生产报告”,MapEnableRights=PXCacheRights.Select)]
[PXButton(SpecialType=PXSpecialButtonType.ReportsFolder)]
受保护的虚拟IEnumerable屏幕打印报告(PXAdapter)
{
List=adapter.Get().ToList();
如果(list.Count>0)
{
字符串creportID=“SO641010”;
string reportID=“PS642000”;
Base.Save.Press();
字典参数=新字典();
字符串actualReportID=null;
PXReportRequiredException ex=null;
Dictionary reportsToPrint=新字典();
foreach(按列表中的顺序排序)
{
PSSOOrderExtNV extNV=Base.Document.Cache.GetExtension(订单);
如果(extNV.UsrIsScreenPrint!=真)
继续;
参数=新字典();
参数[“SOOrder.OrderType”]=order.OrderType;
参数[“SOOrder.OrderNbr”]=order.OrderNbr;
对象cstmr=PXSelectorAttribute.Select(Base.Document.Cache,order);
actualReportID=new NotificationUtility(Base).SearchReport(SONotificationSource.Customer、cstmr、creportID、order.BranchID);
ex=PXReportRequiredException.CombineReport(ex,actualReportID,参数);
ReportStopPrint=PX.SM.SMPrintJobMaint.AssignPrintJobToPrinter(ReportStopPrint,参数,适配器,新通知实用程序(基本)。SearchPrinter,SONotificationSource.Customer,creportID,actualReportID,order.BranchID);
actualReportID=null;
actualReportID=new NotificationUtility(Base).SearchReport(SONotificationSource.Customer,cstmr,reportID,order.BranchID);
ex=PXReportRequiredException.CombineReport(ex,actualReportID,参数);
reportsToPrint=PX.SM.SMPrintJobMaint.AssignPrintJobToPrinter(reportsToPrint、参数、适配器、新通知实用程序(基本)。SearchPrinter、SONotificationSource.Customer、reportID、actualReportID、order.BranchID);
}
如果(ex!=null)
{
PX.SM.SMPrintJobMaint.CreatePrintJobGroups(ReportStopPrint);
掷骰子;
}
}
}