I have written a codeunit which will run through JOB QUEUE and save the report in an predefined local folder.
However when i want to save the same file to a shared network folder, I am getting error. How do I achieve this?
I am using ON-PREMISE BC and I am using ExcelReport.SaveAsExcel(FileNameAndPath); to save the report in local folder which is working properly.
var
FileNameAndPath: Text[250];
LoanRec: Record xxx;
ExcelReport: Report /xxx Excel Report/;
Startdate: Date;
Enddate: Date;
begin
Startdate := 20210101D; //Requirement: Start Date 1/1/2021
Enddate := Today;
LoanRec.SetCurrentKey(/Creation Date/);
LoanRec.SetRange(/Creation Date/, Startdate, Enddate);
ExcelReport.SetTableView(LoanRec);
FileNameAndPath := '////xxx//xxx//xx//xx//xx//xxx Excel Report.xlsx';
ExcelReport.SaveAsExcel(FileNameAndPath);
end;
I have the full access to the network folder and when I run the job queue I am getting below error
‘Either the caller does not have the required permission or the specified path is read-only.’
Please provide a solution or alternate way to save the file in network folder.
Thanks in advance.
Rajaneesh H