Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 143529

A currency to convert from is required to retrieve exchange rate information while printing the report in pdf format using code

$
0
0

Hello all,

This is my code to print a report to pdf format.

public static void main(Args _args)
{
SrsReportRunController controller = new SrsReportRunController();
CustTransOpenPerDateContract contract = new CustTransOpenPerDateContract();
SrsReportEMailDataContract emailContract = new SrsReportEMailDataContract();
ExchangeRateHelper exchangeRateHelper = new ExchangeRateHelper();
SRSPrintDestinationSettings settings;

controller.parmReportName(ssrsReportStr(FreeTextInvoice, Report));

controller.parmExecutionMode(SysOperationExecutionMode::ScheduledBatch);

controller.parmShowDialog(false);
exchangeRateHelper.parmFromCurrency(“USD”);

controller.parmReportContract().parmRdpContract(contract);

settings = controller.parmReportContract().parmPrintSettings();
settings.printMediumType(SRSPrintMediumType::File);
settings.fileFormat(SRSReportFileFormat::PDF);
settings.overwriteFile(true);
settings.fileName(@’C:\Users\sst_siddhant\Desktop\PDFfile.pdf’);

controller.startOperation();
}
I am getting an error –
1.A currency to convert from is required to retrieve exchange rate information.
2.Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type ‘Microsoft.Dynamics.Ax.Xpp.ErrorException’ was thrown.
What will be the solution for this issue.

Thank You
Siddhant Singh


Viewing all articles
Browse latest Browse all 143529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>