{"id":94,"date":"2023-11-09T13:52:16","date_gmt":"2023-11-09T05:52:16","guid":{"rendered":"https:\/\/live-d365fo.pantheonsite.io\/?p=94"},"modified":"2024-07-19T17:47:54","modified_gmt":"2024-07-19T09:47:54","slug":"how-to-create-ssrs-report-in-d365fo-part2-controller-class","status":"publish","type":"post","link":"https:\/\/dev-d365fo.pantheonsite.io\/how-to-create-ssrs-report-in-d365fo-part2-controller-class\/","title":{"rendered":"\u5982\u4f55\u5728D365FO\u521b\u5efaSSRS\u62a5\u8868\uff08\u4e8c\uff09Controller Class\uff08how-to-create-ssrs-report-in-d365fo-part2-controller-class\uff09"},"content":{"rendered":"\n
\u5982\u679c\u6ca1\u6709\u7279\u6b8a\u8981\u6c42\uff0c\u4ee5\u4e0b\u4ee3\u7801\u5c31\u53ef\u4ee5\u641e\u5b9a\u3002<\/p>\n\n\n\n
\npublic class Demo_InventJournalTransTransferController extends SrsReportRunController\n{\n \n public static void main(Args _args)\n {\n Demo_InventJournalTransTransferController controller \n = new Demo_InventJournalTransTransferController();\n \n controller.parmReportName(ssrsReportStr(Demo_InventJournalTransTransfer, Report));\n controller.parmDialogCaption(\"@Demo954\");\n controller.parmArgs(_args);\n controller.startOperation();\n }\n}\n<\/pre>\n\n\n\n\u591a\u9009<\/h2>\n\n\n\n
\u5982\u679c\u9700\u8981\u6253\u5370\u7528\u6237\u6240\u9009\u7684\u6570\u636e\uff0c\u591a\u9009\u9700\u8981\u7528\u5230 MultiSelectionHelper<\/strong><\/p>\n\n\n\n\npublic class Demo_InventJournalTransTransferController extends SrsReportRunController\n{\n ......\n\n public void preRunModifyContract()\n {\n Demo_InventJournalTransTransferContract contract \n = this.parmReportContract().parmRdpContract() as Demo_InventJournalTransTransferContract; \n }\n\n public void prePromptModifyContract()\n {\n Demo_InventJournalTransTransferContract contract;\n\n contract = this.parmReportContract().parmRdpContract() as Demo_InventJournalTransTransferContract;\n\n this.setRanges(\n this.parmReportContract().parmQueryContracts().lookup(this.getFirstQueryContractKey())\n , contract);\n }\n\n public void setRanges(\n Query _query,\n Demo_InventJournalTransTransferContract _contract)\n {\n MultiSelectionHelper multiSelectionHelper;\n\n if (this.parmArgs().dataset() == tableNum(InventJournalTable) && this.parmArgs().caller())\n {\n _query.dataSourceTable(tableNum(InventJournalTable)).clearRanges();\n multiSelectionHelper = MultiSelectionHelper::createFromCaller(this.parmArgs().caller());\n multiSelectionHelper.createQueryRanges(_query.dataSourceTable(tableNum(InventJournalTable))\n , fieldStr(InventJournalTable, JournalId));\n }\n\n }\n\n}\n<\/pre>\n\n\n\n\u5982\u679c\u9700\u8981\u6839\u636ePrint management\u7684\u8bbe\u5b9a\u6765\u6253\u5370,\u8bf7\u53c2\u8003\u6587\u7ae0\uff1a<\/p>\n\n\n