It is obvious that we customize many document reports e.g. Sales order, Purchase order, Quotation, Projects for a new report design and call the report from different journal accordingly. There are few ways to specify the new report design, using Print management document or setting this new report design as a system report in the table "PrintMgmtReportFormat".
In most of the cases, AX SSRS report controller class call for the system report from PrintMgmtReportFormat table using the following method:
PrintMgmtReportFormat::findSystem(this.getPrintMgmtDocumentType()).Name); The controller class has a method "runPrintMgmt" which is responsible for defaulting the system report. In this method, the class object FormLetterReport does the actual job for calling and assigning system report with printer setting. formLetterReport.loadPrintSettings(custQuotationJour, custQuotationJour.salesQuotationTable(), this.quoteLanguageId()); So here my code goes. I write a method and call this after the above line of code in the controller class. This custom method basically initializes the PrintMgmtPrintSettingDetail object and conditionally, I am passing my custom report design. In this way, it overrides the print setting with my new report design.
void customPrintSettings() { PrintMgmtDocInstanceType type; PrintMgmtPrintSettingDetail printSettingDetail = new PrintMgmtPrintSettingDetail(); SRSPrintDestinationSettings defaultSettings = formLetterReport.parmReportRun().parmDefaultOriginalPrintJobSettings(); PrintMgmtReportFormatName reportFormatName = ssrsReportStr(PSAQuotations, CustomReportSG); //Passing custom report design if (formLetterReport.parmPrintType() == PrintCopyOriginal::Original) { type = PrintMgmtDocInstanceType::Original; } if (formLetterReport.parmPrintType() == PrintCopyOriginal::Copy) { type = PrintMgmtDocInstanceType::Copy; } printSettingDetail.parmReportFormatName(reportFormatName); printSettingDetail.parmType(type); printSettingDetail.parmInstanceName(enum2str(type)); // Since this will be reported to the screen, one copy is the only thing that makes sense printSettingDetail.parmNumberOfCopies(1); printSettingDetail.parmPrintJobSettings(defaultSettings); if (!formLetterReport.parmUseUserDefinedDestinations()) { printSettingDetail.parmPrintJobSettings().printMediumType( SRSPrintMediumType::Screen); } formLetterReport.parmReportRun().loadSettingDetail(printSettingDetail); }
A report library is a project in the VS(Visual Studio) where we have one or more report model (.moxl) files. A report model does not define a report in MS SQL. A report model has five components and one of them is Design. This Design is again further divided as AutoDesign and PrecisionDesign. For each design, we have RDL (Report Definition Langauage). This RDL later is deployed to SQL reporting server.