{"id":122,"date":"2023-11-09T16:36:42","date_gmt":"2023-11-09T08:36:42","guid":{"rendered":"https:\/\/live-d365fo.pantheonsite.io\/?p=122"},"modified":"2023-11-30T10:18:09","modified_gmt":"2023-11-30T02:18:09","slug":"how-to-print-ssrs-report-by-print-management","status":"publish","type":"post","link":"https:\/\/dev-d365fo.pantheonsite.io\/how-to-print-ssrs-report-by-print-management\/","title":{"rendered":"\u5982\u4f55\u901a\u8fc7Print management \u6253\u5370SSRS\u62a5\u8868\uff08how-to-print-ssrs-report-using-print-management\uff09"},"content":{"rendered":"\n

\u62a5\u8868\u6253\u5370\u7ba1\u7406Print management<\/h1>\n\n\n\n

\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684Report format<\/strong><\/h2>\n\n\n\n

\u5982\u4e0b\u56fe\u4e3aCustomer invoice\u6dfb\u52a0\u4e24\u4e2a\u65b0\u7684Report format<\/p>\n\n\n\n

\"\"\/<\/figure>\n\n\n\n

<\/p>\n\n\n\n

\u56fe\u4e2d\u7684\u4e24\u4e2aReport format\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u4e00\u4e0b\u4ee3\u7801\u53ef\u4ee5\u5b9e\u73b0<\/p>\n\n\n\n

\n[ExtensionOf(classStr(PrintMgmtReportFormatPopulator))]\npublic final class PrintMgmtReportFormatPopulator_Demo_Extension\n{\n    #PrintMgmtSetup\n\n    protected void addDocuments()\n    {\n        \/\/ Add new customized reports\n        this.addOther(PrintMgmtDocumentType::SalesOrderInvoice, ssrsReportStr(DocSalesInvoice, Report), ssrsReportStr(DocSalesInvoice, Report), #NoCountryRegionId);\n        this.addOther(PrintMgmtDocumentType::SalesOrderInvoice, ssrsReportStr(DocSalesInvoiceExt, Report), ssrsReportStr(DocSalesInvoiceExt, Report), #NoCountryRegionId);\n        \/\/ Add the standard report design, because of PrintMgmtDocType.getDefaultReportFormatDelegate()\n        this.addOther(PrintMgmtDocumentType::SalesOrderInvoice, ssrsReportStr(SalesInvoice, Report), ssrsReportStr(Sal\n        next addDocuments();\n    }\n}\n\n<\/pre>\n\n\n\n

\u4e0b\u6b21\u6253\u5f00Print management setup\u7684\u65f6\u5019\uff0cPrintMgmtReportFormat \u8868\u4e2d\u5c31\u4f1a\u6dfb\u52a0\u4e86 2 \u6761\u65b0\u8bb0\u5f55\u3002<\/p>\n\n\n\n

\"\"\/<\/figure>\n\n\n\n

<\/p>\n\n\n\n

\u6539\u53d8\u9ed8\u8ba4\u7684 Report format<\/strong><\/h2>\n\n\n\n

\u5982\u679c\u60a8\u9700\u8981\u66f4\u6539Original\/Copy preview\u7684\u9ed8\u8ba4\u7684 Report format\uff0c<\/strong>Microsoft \u5efa\u8bae\u4fee\u6539PrintMgmtDocType.getDefaultReportFormatDelegate()<\/strong>\uff1a<\/p>\n\n\n\n

\nclass THK_PrintMgmtDocTypeEventHandler\n{\n  [SubscribesTo(classStr(PrintMgmtDocType), delegateStr(PrintMgmtDocType, getDefaultReportFormatDelegate))]\n  public static void PrintMgmtDocType_getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)\n  {\n      switch (_docType)\n      {\n          case PrintMgmtDocumentType::SalesOrderInvoice:\n              _result.result(ssrsReportStr(DocSalesInvoice, Report));\n              break;\n      }\n  }\n}\n<\/pre>\n\n\n\n

<\/p>\n\n\n\n

\u6253\u5370Original\/Copy preview\u7684\u65f6\u5019\uff0c\u7cfb\u7edf\u76ee\u524d\u4ecd\u7136\u4f1a\u6253\u5370\u9ed8\u8ba4\u7684Report format\uff0c\u800c\u975e\u7528\u6237\u4e0b\u62c9\u9009\u62e9\u7684Format\uff08Bug\uff1f\uff09\uff0c\u56e0\u6b64\u9700\u8981\u901a\u8fc7\u4e00\u4e0b\u4ee3\u7801\u4fee\u590d\uff1a<\/p>\n\n\n\n

\nclass THK_PrintMgmtDocTypeEventHandler\n{\n  [SubscribesTo(classStr(PrintMgmtDocType), delegateStr(PrintMgmtDocType, getDefaultReportFormatDelegate))]\n  public static void PrintMgmtDocType_getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)\n  {\n      switch (_docType)\n      {\n          case PrintMgmtDocumentType::SalesOrderInvoice:\n              _result.result(ssrsReportStr(DocSalesInvoice, Report));\n                  PrintMgmtReportFormatName formatName = THK_PrintMgmtDocTypeEventHandler::getPrintMgmtReportFormat(_docType);\n                  if (formatName)\n                  {\n                      _result.result(formatName);\n                  }\n                  else\n                  {\n                      _result.result(ssrsReportStr(SalesInvoice, Report));\n                  } \n              break;\n      }\n  }\n  public static PrintMgmtReportFormatName getPrintMgmtReportFormat(PrintMgmtDocumentType    _printMgmtDocumentType)\n  {\n      PrintMgmtDocInstance printMgmtDocInstance;\n      PrintMgmtReportFormat printMgmtReportFormat;\n      PrintMgmtSettings printMgmtSettings;\n\n      select firstonly DocumentType, RecId from printMgmtDocInstance\n      where printMgmtDocInstance.DocumentType == _printMgmtDocumentType\n      join ParentId, ReportFormat from printMgmtSettings\n          where printMgmtSettings.ParentId == printMgmtDocInstance.RecId\n      join RecId, DocumentType, Name from printMgmtReportFormat\n          where printMgmtReportFormat.RecId == printMgmtSettings.ReportFormat\n          && printMgmtReportFormat.DocumentType == _printMgmtDocumentType;\n\n      return printMgmtReportFormat.Name;\n  }\n}\n<\/pre>\n\n\n\n

\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684Document type<\/h2>\n\n\n\n

\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684Document type<\/p>\n\n\n\n

\u521b\u5efaPrintMgmtDocumentType\u7684Coc\u6269\u5c55\uff0c\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u8282\u70b9<\/h3>\n\n\n\n
\"\"\/<\/figure>\n\n\n\n

<\/p>\n\n\n\n

\u521b\u5efaNode class ( \u4f8b\u5982PrintMgmtNode_Purch<\/code>)\u4e2d\u65b9\u6cd5getDocumentTypes<\/code>\u7684Coc\u6269\u5c55 <\/h3>\n\n\n\n
\n[ExtensionOf(classStr(PrintMgmtNode_Purch))]\npublic final class PrintMgmtNode_Purch_Demo_Extension\n{\n    \/\/\/ \n\n    \/\/\/ Gets a list of valid document types for the node.\n    \/\/\/ \n\n    \/\/\/ \n    \/\/\/    A list of valid document types for the node.\n    \/\/\/ \n    \/\/\/ \n    \/\/\/ The results can vary based on what is configured in the application because configuration keys are\n    \/\/\/    used to determine this list.\n    \/\/\/ \n    public List getDocumentTypes()\n    {\n        List ret = next getDocumentTypes();\n\n        ret.addEnd(PrintMgmtDocumentType::customPurchPromptLetter);\n\n        return ret;\n    }\n\n}\n<\/pre>\n\n\n\n

\u4e4b\u540e\u5c31\u53ef\u4ee5\u5728Print management \u4e2d\u770b\u5230\u6211\u4eec\u65b0\u52a0\u7684\u8282\u70b9\u4e86<\/p>\n\n\n\n

\u521b\u5efa\u65b0\u7684Form letter\u7c7b<\/h3>\n\n\n\n

\u8fd9\u4e2a\u7c7b\u7528\u6765\u8fd4\u56de hierarchy \u548c\u524d\u9762\u521b\u5efa\u7684document type<\/p>\n\n\n\n

\n[PrintMgmtDocumentTypeFactoryAttribute(PrintMgmtDocumentType::customPurchPromptLetter)]\npublic class customPurchFormLetterReport_PromptLetter extends PurchFormLetterReport\n{\n    \/\/\/ \n\n    \/\/\/ Returns the default printer settings for the specified PrintSetupOriginalCopy enumeration value.\n    \/\/\/ \n\n    \/\/\/ \n    \/\/\/ The PrintSetupOriginalCopy enumeration value that specifies whether the Original\n    \/\/\/ or Copy destinations should be retrieved.\n    \/\/\/ \n    \/\/\/ \n    \/\/\/ The default printer settings for the specified PrintSetupOriginalCopy enumeration value.\n    \/\/\/ \n    \/\/\/ \n    \/\/\/ The general pattern for implementing this method is to use the printer destinations from the appropriate\n    \/\/\/ FormLetter class.  These printer destinations will be used if no Print Management destinations are\n    \/\/\/ found or used.\n    \/\/\/ \n    protected container getDefaultPrintJobSettings(PrintSetupOriginalCopy _printCopyOriginal)\n    {\n        if (_printCopyOriginal == PrintSetupOriginalCopy::Original)\n        {\n            return PurchFormLetter::getPrinterSettingsFormletter(DocumentStatus::None,PrintSetupOriginalCopy::Original);\n        }\n        else\n        {\n            return PurchFormLetter::getPrinterSettingsFormletter(DocumentStatus::None,PrintSetupOriginalCopy::Copy);\n        }\n    }\n    \n    \/\/\/ \n\n    \/\/\/ Returns the PrintMgmtDocumentType enumeration value that specifies what document this FormLetterReport class controls.\n    \/\/\/ \n\n    \/\/\/ \n    \/\/\/ The PrintMgmtDocumentType enumeration value that specifies what document this FormLetterReport class controls.\n    \/\/\/ \n    \/\/\/ \n    \/\/\/ This value is used to retrieve the appropriate Print Management settings for the report.\n    \/\/\/ \n    public PrintMgmtDocumentType getPrintMgmtDocumentType()\n    {\n        return PrintMgmtDocumentType::customPurchPromptLetter;\n    }\n\n    \/\/\/ \n\n    \/\/\/ Returns the PrintMgmtHierarchyType enumeration value that specifies what hierarchy this FormLetterReport class uses.\n    \/\/\/ \n\n    \/\/\/ \n    \/\/\/ The PrintMgmtHierarchyType enumeration value that specifies what hierarchy this FormLetterReport class uses.\n    \/\/\/ \n    \/\/\/ \n    \/\/\/ This value is used to retrieve the appropriate Print Management settings for the report.\n    \/\/\/ \n    protected PrintMgmtHierarchyType getPrintMgmtHierarchyType()\n    {\n        return PrintMgmtHierarchyType::Purch;\n    }\n\n    \/\/\/ \n\n    \/\/\/ Returns the PrintMgmtNodeType enumeration value that specifies what node this FormLetterReport class uses.\n    \/\/\/ \n\n    \/\/\/ \n    \/\/\/ The PrintMgmtNodeType enumeration value that specifies what node this FormLetterReport class uses.\n    \/\/\/ \n    \/\/\/ \n    \/\/\/ This value is used to retrieve the appropriate Print Management settings for the report.\n    \/\/\/ \n    protected PrintMgmtNodeType getPrintMgmtNodeType()\n    {\n        return PrintMgmtNodeType::PurchTable;\n    }\n}\n<\/pre>\n\n\n\n

\u6700\u540eCoc\u6269\u5c55populator\u7c7b<\/strong><\/h3>\n\n\n\n

\u8fd9\u4e2a\u7c7b\u7684\u4f5c\u7528\u53ef\u4ee5\u53c2\u8003\u524d\u6587\u201c\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684Report format\u201d<\/p>\n\n\n\n

\n\/\/\/ \n\n\/\/\/ Populates the PrintMgmtReportFormat table used for print management with the MyProject documents.\n\/\/\/ \n\n[ExtensionOf(classStr(PrintMgmtReportFormatPopulator))]\npublic final class PrintMgmtReportFormatPopulatorAppSuite_custom_Extension\n{\n    #ISOCountryRegionCodes\n    #PrintMgmtSetup\n\n    protected void addDocuments()\n    {\n        \/\/ Purchasing documents\n        this.customAddPurchaseDocuments();\n\n        next addDocuments();\n    }\n\n    \/\/\/ \n\n    \/\/\/ Adds purchase records to the PrintMgmtReportFormat table.\n    \/\/\/ \n\n    protected void customAddPurchaseDocuments()\n    {\n        this.addOther(PrintMgmtDocumentType::customPurchPromptLetter, ssrsReportStr(customPurchPromptLetterReport, Report), ssrsReportStr(customPurchPromptLetterReport, Report), #NoCountryRegionId);\n    }\n\n}\n<\/pre>\n\n\n\n

\u5b8c\u6210\uff01<\/h3>\n\n\n\n
\"\"\/<\/figure>\n","protected":false},"excerpt":{"rendered":"

\u62a5\u8868\u6253\u5370\u7ba1\u7406Print management \u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684Report format \u5982\u4e0b\u56fe\u4e3aCustomer invoice\u6dfb\u52a0\u4e24\u4e2a\u65b0\u7684Report format \u56fe\u4e2d\u7684\u4e24\u4e2aReport format\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u4e00\u4e0b\u4ee3\u7801\u53ef\u4ee5\u5b9e\u73b0 [ExtensionOf(classStr(PrintMgmtReportFormatPopulator))] public final class PrintMgmtReportFormatPopulator_Demo_Extension { #PrintMgmtSetup protected void addDocuments() { \/\/ Add new customized reports this.addOther(PrintMgmtDocumentType::SalesOrderInvoice, ssrsReportStr(DocSalesInvoice, Report), ssrsReportStr(DocSalesInvoice, Report), #NoCountryRegionId); this.addOther(PrintMgmtDocumentType::SalesOrderInvoice, ssrsReportStr(DocSalesInvoiceExt, Report), ssrsReportStr(DocSalesInvoiceExt, Report), #NoCountryRegionId); \/\/ Add the standard report design, because of PrintMgmtDocType.getDefaultReportFormatDelegate() this.addOther(PrintMgmtDocumentType::SalesOrderInvoice, ssrsReportStr(SalesInvoice, Report), ssrsReportStr(Sal next addDocuments(); } } \u4e0b\u6b21\u6253\u5f00Print …<\/p>\n

Continue reading ‘\u5982\u4f55\u901a\u8fc7Print management \u6253\u5370SSRS\u62a5\u8868\uff08how-to-print-ssrs-report-using-print-management\uff09’ »<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[9,3,10],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/posts\/122"}],"collection":[{"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":99,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"predecessor-version":[{"id":583,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/posts\/122\/revisions\/583"}],"wp:attachment":[{"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}