Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Getting error Access to the path is denied

$
0
0

Hi Everyone,

I am generating report through X++ and saving it as pdf and emailing as attachment. This has to be done for all employees. 

When I run the class it is working fine, but when I run the class through batch I am getting the error 

Access to the path is denied when the code is generating the report for the second time on wards. 

I have given all Read/write permission to Everyone and I have even given permission in Report server to AOS service and report server accounts. Below is my code

filepath = @"C:\Email\VendorAgingReport.pdf";

queryContracts = contract.parmQueryContracts();

mapEnum = queryContracts.getEnumerator();

printerSettings = ssrsController.parmReportContract().parmPrintSettings();

printerSettings.printMediumType(SRSPrintMediumType::File);
printerSettings.fileFormat(SRSReportFileFormat::PDF);
permissionSet = new Set(Types::Class);
permissionSet.add(new InteropPermission(InteropKind::ClrInterop));
permissionSet.add(new FileIOPermission(filepath, 'rw'));
CodeAccessPermission::assertMultiple(permissionSet);

error trigger point
printerSettings.fileName(filepath));


Viewing all articles
Browse latest Browse all 175888

Trending Articles



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