是否可以从report designer自动创建zpl文件并将其发送到热敏打印机?用例是我们需要为我们的库存和系列商品打印“标签”。我们有一个自定义的输出报告,需要能够将其作为zpl文件格式发送到标签打印机。
发布于 2018-10-20 16:44:53
Acumatica DeviceHub有一个专门为标签打印机设计的“原始模式”。在开发高级实现模块时,我使用Zebra打印机和ZPL对其进行了广泛的测试。
recent blog post by Sergey Marenich谈到了DeviceHub;您将找不到有关如何使用raw模式的任何信息,但它确实解释了设备集线器、打印队列以及如何发送作业的基础知识。Device Hub现在是Acumatica 2018 R2的一部分(它曾经作为高级履行预发布模块的单独下载提供),在源代码浏览器中,您可以找到相当多使用它的示例,包括来自SOShipmentEntry
的与标签一起工作的示例。PX.SM.SMPrintJobMaint.CreatePrintJobForRawFile
是您需要调用的函数。
if (lableFiles.Count > 0)
{
FileInfo mergedFile = MergeFiles(lableFiles);
if (upload.SaveFile(mergedFile))
{
if (PXAccess.FeatureInstalled<FeaturesSet.deviceHub>())
PX.SM.SMPrintJobMaint.CreatePrintJobForRawFile(adapter, new NotificationUtility(this).SearchPrinter, SONotificationSource.Customer, SOReports.PrintLabels, Accessinfo.BranchID, new Dictionary<string, string> { { "FILEID", mergedFile.UID.ToString() } },
PXMessages.LocalizeFormatNoPrefix(SOShipmentEntryActionsAttribute.Messages.PrintLabels, mergedFile.ToString()));
targetUrl = PXRedirectToFileException.BuildUrl(mergedFile.UID);
}
else
{
throw new PXException(Messages.FailedToSaveMergedFile);
}
}
https://stackoverflow.com/questions/52906911
复制相似问题