-2

如何在本地同时生成多个文本文件?

我使用的方法是: throw new PXRedirectToFileException (file, true); ![在此处输入图像描述][1]

但是,此方法仅生成 1 个文本文件。我需要一次生成多个文本文件。

                List<object> data1099Misc = new List<object> { };
                ARInvoice ari = Base.Document.Current;
                foreach (xvrFSCab diot in PXSelect<xvrFSCab,
                Where<xvrFSCab.invoiceNbr,
                In<Required<xvrFSCab.invoiceNbr>>>>.Select(Base, ari.InvoiceNbr))
                {
                    data1099Misc.Add(CreatePayerARecord(diot));
                }

                FixedLengthFile flatFile = new FixedLengthFile();

                flatFile.WriteToFile(data1099Misc, sw);
                sw.Flush();
                sw.FlushAsync();
                int cont = 0;
                while ( cont<3)
                {
                    cont = cont + 1;
                    string path = "DIOTJOSE" + ".txt";
                    PX.SM.FileInfo file = new PX.SM.FileInfo(path, null, stream.ToArray());
                    throw new PXRedirectToFileException(file, true);
                }
4

1 回答 1

0

当 Acumatica 必须一键打开多个报表时(使用 RedirectException),他们也遇到了同样的问题。

出于这个原因,Acumatica 仅支持报告的多个RequiredException。他们有一个名为“CombineReport”的方法,该方法适用于多个 PXReportRequiredException (PXReportsRedirectList)

可悲的是,他们没有为其他 RequiredException 或RedirectException做点什么

我尝试制作自己的“组合”方法,但我无法创建它,因为 RedirectHelper.TryRedirect 方法在正文中使用硬编码的 RedirectException 类型而不是使用通用或基础对象:(

于 2019-07-08T18:18:13.937 回答