FreeTextInvoiceContract contractFree = new FreeTextInvoiceContract();
FreeTextInvoiceController controllerFree = new FreeTextInvoiceController();
SRSReportRunService srsReportRunService = new SrsReportRunService();
SRSReportExecutionInfo executionInfo = new SRSReportExecutionInfo();
CustInvoiceJour custInvoiceJour;
CustInvoiceTable custinvoiceTable = _args.record();
info(any2Str(custinvoiceTable.InvoiceId));
select custInvoiceJour where custInvoiceJour.InvoiceId == custinvoiceTable.InvoiceId;
Args args = new Args(), argsMenuFunction = new Args();
str ruta, rutaCliente;
Map reportParametersMap;
SRSProxy srsProxy;
SRSPrintDestinationSettings settings;
System.Byte[] reportBytes = new System.Byte[0]();
Microsoft.Dynamics.AX.Framework.Reporting.Shared.ReportingService.ParameterValue[] parameterValueArray;
args.record(custInvoiceJour);
args.parmEnum(PrintCopyOriginal::Copy);
args.parmEnumType(enumNum(PrintCopyOriginal));
args.parm("Report");
contractFree.parmPrintCopyOriginal(PrintCopyOriginal::Copy);
contractFree.parmInstanceType(PrintMgmtDocInstanceType::Copy);
contractFree.parmCustInvoiceJourRecId(custInvoiceJour.RecId);
contractFree.parmSuppressDepreciationOfPaymentSection(true);
controllerFree.parmArgs(args);
controllerFree.parmReportName(ssrsReportStr(FreeTextInvoiceCopy1, MZNUKReport_AR));
controllerFree.parmShowDialog(false);
controllerFree.parmLoadFromSysLastValue(false);
controllerFree.parmReportContract().parmRdpContract(contractFree);
controllerFree.parmReportContract().parmRdlContract().parmLanguageId(custInvoiceJour.LanguageId);
controllerFree.parmExecutionMode(SysOperationExecutionMode::Synchronous);
settings = controllerFree.parmReportContract().parmPrintSettings();
settings.printMediumType(SRSPrintMediumType::File);
settings.fileName(strFmt('%1.pdf', custinvoiceTable.InvoiceId));
settings.fileFormat(SRSReportFileFormat::PDF);
controllerFree.parmReportContract().parmReportServerConfig(SRSConfiguration::getDefaultServerConfiguration());
controllerFree.parmReportContract().parmReportExecutionInfo(executionInfo);
srsReportRunService.getReportDataContract(controllerFree.parmreportcontract().parmReportName());
srsReportRunService.preRunReport(controllerFree.parmreportcontract());
reportParametersMap = srsReportRunService.createParamMapFromContract(controllerFree.parmReportContract());
parameterValueArray = SrsReportRunUtil::getParameterValueArray(reportParametersMap);
srsProxy = SRSProxy::constructWithConfiguration(controllerFree.parmReportContract().parmReportServerConfig());
reportBytes = srsproxy.renderReportToByteArray(controllerFree.parmreportcontract().parmreportpath(), parameterValueArray, settings.fileFormat(), settings.deviceinfo());
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156