Grant write access to the output folder
EnvisionSCADA runs under IIS and writes report files as the IIS application pool identity. Before the Report Designer or a Python script can write files to a folder on the C drive, that folder must grant Modify permission to the IIS_IUSRS group.
Open the folder properties in Windows Explorer, go to the Security tab, and add IIS_IUSRS with at least Modify, Read & execute, List folder contents, Read, and Write checked under Allow.
Alternatively, open an elevated command prompt and run the following command, replacing the path with your actual output folder:
icacls "C:\EnvisionReports" /grant "IIS_IUSRS:(OI)(CI)M" /TTroubleshooting: Error Applying Security
When applying permissions through the Windows Security dialog, you may see the following error on one or more files inside the folder:
Failed to enumerate objects in the container. Access is denied.
This occurs when a file inside the folder is locked by another process, for example a PDF viewer or the EnvisionSCADA report runner that has a report file open. The error dialog offers a Continue button: clicking it skips the locked file and applies the new permissions to all other files and subfolders. Files written after this point inherit the new permissions from the folder and are not affected.
To avoid this error entirely, use icacls from an elevated command prompt instead of the Security dialog. The icacls command applies permissions at the folder level and propagates them via inheritance without needing to enumerate and rewrite every existing file:
icacls "C:\EnvisionReports" /grant "IIS_IUSRS:(OI)(CI)M" /TCreate the virtual directory
If you want to make files such as reports available to EnvisionSCADA clients, add a folder on the IIS server and expose it through a virtual directory.
Example: place a report file in C:\Reports and expose it as the /Reports alias in IIS.
- Open IIS Manager.
- Select the website that hosts EnvisionSCADA.
- Right-click the site and choose Add Virtual Directory.
- Set the Alias to Reports.
- Point the Physical path to C:\Reports.
- Make sure the folder has read permissions for the IIS user.
Download the file from a page or global script
Once the folder is published under the website, you can download the file from a custom page or global script. The example below resolves the download URL automatically from the current host and the virtual directory name.
async function downloadExcel(fileName) {
const reportUrl = `${window.location.origin}/Reports/${fileName}`;
console.log(reportUrl);
const response = await fetch(reportUrl);
if (!response.ok) {
throw new Error(`Failed to download file: ${response.status}`);
}
const blob = await response.blob();
const downloadUrl = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = downloadUrl;
link.download = fileName || 'report.xlsx';
link.click();
window.URL.revokeObjectURL(downloadUrl);
}
// Example: download a report file that exists in the IIS virtual directory
// downloadExcel('daily_report.xlsx');