Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to change customer account statement report pdf file name when emailed using print destinations

(0) ShareShare
ReportReport
Posted on by 195

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.

  • Suggested answer
    RE: How to change customer account statement report pdf file name when emailed using print destinations

    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)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans