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
*This post is locked for comments