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);
}
}
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156