Hi Everyone,
I got an requirement to change the customer statement file name from standard AX name "CustAccountStatementExt.Report.pdf" to new file name which includes customer Id & customer name like "A001-customer name.pdf" in Ax 2012 version.
I have tired by using the below code in runPrintMgmt method in CustAccountStatementExtController class by the reference of below link but no luck:
theinfolog.com/printing-external-customer-statements-to-multiple-file-names
srsPrintDestinationSettings = this.parmReportContract().parmPrintSettings();
if(srsPrintDestinationSettings.printMediumType() == SRSPrintMediumType::Email)
{
originalfilename = Global::fileNameSplit(srsPrintDestinationSettings.fileName());
filename = conPeek(originalfilename,1);
filename += custTable.AccountNum + '-';
filename += custTable.name();
filename += conPeek(originalfilename,3);
srsPrintDestinationSettings.overridePrintContractSettings(true);
srsPrintDestinationSettings.printMediumType(SRSPrintMediumType::Email);
srsPrintDestinationSettings.fileFormat(SRSReportFileFormat::PDF);
srsPrintDestinationSettings.overwriteFile(true);
srsPrintDestinationSettings.fileName(filename);
this.parmReportContract().parmPrintSettings(srsPrintDestinationSettings);
}
Can anyone help to solve it?
Regards,
Swetha.
Hello Swetha,
Similar issue has been raised previously and also there are blogs where you find good guidance:
Change the filename of an SSRS report when emailed through X++
Customizing default filename when saving SSRS report (Ax 2012)
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156