web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Sales invoice report - download multiple sales invoice on a single button click

(0) ShareShare
ReportReport
Posted on by 139

Hi experts

I am working on Sales invoice report and the requirement is that -

We select multiple invoices and add one button. On the button click selected invoices download into archive folder.

I tried all ways but no luck.

I am looking your help. Kindly suggest some solution

many thanks in advance.

Below things I have done:

1. created new controller class and wrote below code but got the currency exchange related error that is the reason wrote exchange rate related ocde but

    still I am getting the same exchange rate related error

public class XXXSalesInvoiceController extends SrsReportRunController

{

public static void main(Args _args)

{
XXXSalesInvoiceController controller = new XXXSalesInvoiceController();
SalesInvoiceContract rdpContract = new SalesInvoiceContract();
ExchangeRateHelper exchangeRateHelper = ExchangeRateHelper::construct();
exchangeRateHelper.parmFromCurrency("USD");

controller.parmArgs(_args);
controller.parmReportName(ssrsReportStr(XXX_SalesInvoice, Report));
controller.parmShowDialog(false);
controller.parmReportContract().parmRdpContract(rdpContract);

str ext = SRSPrintDestinationSettings::findFileNameType(SRSReportFileFormat::PDF, SRSImageFileFormat::BMP);
SRSPrintDestinationSettings printerSettings = controller.parmReportContract().parmPrintSettings();
printerSettings.printMediumType(SRSPrintMediumType::File);
printerSettings.fileFormat(SRSReportFileFormat::PDF);
printerSettings.parmFileName('custInvoiceJour.InvoiceId' + ext);
printerSettings.overwriteFile(true);

controller.startOperation();
}

2. My second attempt is:

ExtensionOf(classStr(PrintMgmtReportRun))]
final class XXX_PrintMgmtReportRun_Class_Extension

{

public void loadSettingDetail(PrintMgmtPrintSettingDetail _settingDetail, str _documentKeyValue)
{
SalesInvoiceController invController;
CustInvoiceJour custInvoiceJour;

if (this.parmDocType() == PrintMgmtDocumentType::SalesOrderInvoice)
{
if (ssrsReportStr(XXX_SalesInvoice, Report) == this.parmReportRunController().parmReportName())
{
invController = this.currentController;
custInvoiceJour = invController.parmArgs().record() as CustInvoiceJour;

_settingDetail.parmReportFormatName(ssrsReportStr(SalesInvoice, Report));


str ext = SRSPrintDestinationSettings::findFileNameType(SRSReportFileFormat::PDF, SRSImageFileFormat::BMP);
SRSPrintDestinationSettings printerSettings = invController.parmReportContract().parmPrintSettings();
printerSettings.printMediumType(SRSPrintMediumType::File);
printerSettings.fileFormat(SRSReportFileFormat::PDF);
printerSettings.parmFileName(custInvoiceJour.InvoiceId + ext);
printerSettings.overwriteFile(true);

}
}

next loadSettingDetail(_settingDetail, _documentKeyValue);
}

3. Third attempt:

[ExtensionOf(classStr(SalesInvoiceController))]
final public class XXX_SalesInvoiceController_Class_Extension
{

protected void runPrintMgmt()
{

  str ext = SRSPrintDestinationSettings::findFileNameType(SRSReportFileFormat::PDF, SRSImageFileFormat::BMP);
 SRSPrintDestinationSettings printerSettings;// = formLetterReport.parmReportContract().parmPrintSettings();  // unable to get control instance
 printerSettings.printMediumType(SRSPrintMediumType::File);
 printerSettings.fileFormat(SRSReportFileFormat::PDF);
 printerSettings.parmFileName('custInvoiceJour.InvoiceId' + ext);
 printerSettings.overwriteFile(true);

next runPrintMgmt();
}

protected void prePromptModifyContract()
{
next prePromptModifyContract();

SalesInvoiceContract contract = this.parmReportContract().parmRdpContract() as SalesInvoiceContract;
if(this.parmArgs().dataset() == tableNum(CustInvoiceJour))
{
CustInvoiceJour custInvoiceJour = this.parmArgs().record() as CustInvoiceJour;
contract.parmRecordId(CustInvoiceJour.RecId);

str ext = SRSPrintDestinationSettings::findFileNameType(SRSReportFileFormat::PDF, SRSImageFileFormat::BMP);
SRSPrintDestinationSettings printerSettings = this.parmReportContract().parmPrintSettings();
printerSettings.printMediumType(SRSPrintMediumType::File);
printerSettings.fileFormat(SRSReportFileFormat::PDF);
printerSettings.parmFileName(custInvoiceJour.InvoiceId + ext);
printerSettings.overwriteFile(true);
}
}

I have the same question (0)

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 681 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 598 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 579

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans