Posted in ax 2012

Check physical existance of file

One of many ways to check file existance on folder for

Client side :

 WinAPI::fileExists(_fileName);

And for Server side

System.IO.FileInfo   fileInfo;

new InteropPermission(InteropKind::ClrInterop).assert();

fileInfo = new System.IO.FileInfo(_fileName);

return fileInfo.get_Exists();

Posted in ax 2012

Run RDP based report from Code & passing parameter using Data contract

Bsic Code to run RDP based report using x++ and passing parameters to data contract.

SrsReportRunController controller = new SrsReportRunController();
VendSOAReportTmpContract rdpContract = new VendSOAReportTmpContract ();
SRSPrintDestinationSettings settings;

 

controller.parmReportName(ssrsReportStr(VendSOATmpReport,PrecisionDesign));

controller.parmShowDialog(false);
rdpContract.parmVendAccount(VendPurchOrderJour.OrderAccount);
controller.parmReportContract().parmRdpContract(rdpContract);
controller.startOperation();