This article describes how the OutFile module is used within the Lasernet 9 Default Configuration for the Lasernet FO Connector.
The OutFile output module in the default configuration is used as a type of storage for FO. This type of storage may be used for OnPrem solutions that do not use Azure Storage and, instead, use a file system to print reports.
Setup in Lasernet Connector
Follow these steps within the FO to set up the module:
1. Navigate to Lasernet > Setup > Administration > Connections.
2. Create a new connection with Connection Type: Storage, Type: File System, and specify a Directory path.
This connection will be Lasernet Connector’s output location and Lasernet input location.
3. Create another new connection with Connection Type: Storage, Type: File System, and specify a Directory path.
This connection will be Lasernet’s output location and Lasernet Connector’s archive location
4. Navigate to Lasernet > Setup > Administration > Lasernet Servers.
5. Create a new Lasernet server. Give it a Server name, Description, Default for, and make it Active.
6. Set your Outgoing connection to the file input created in step 2.
7. Set your D365FO connection to reports storage to the file output created in step 3.
The D365FO connection to reports storage’s Connection’s Type determines the OutStorageType jobInfo in the XML. In this case, the OutStorageType will be FileSystem.
8. On Lasernet Server > Lasernet Developer > Modules, ensure ListeningOnFiles is Active and the Directory Path matches the Outgoing Connection on your Lasernet server in step 3. If this is completed and deployed, the Lasernet Server in LAC will Validate successfully.
9. Try printing a report to this server from Dynamics 365 FO. As a test, print to Lasernet Screen.
10. Review the XML file generated by Lasernet Connector. OutputFilePath is populated with the path you determined in the Connection. OutFileStorage is populated, and OutputStorageType is FileSystem.
Process in the Lasernet Server
Follow these steps:
1. Navigate to the Lasernet server > Lasernet Developer > Modules.
2. Select the Destination Selection Pass-Through and select the Destinations tab.
The OutFile output module in the Default configuration depends on the jobInfo runOutFile = true.
This jobinfo is set in script setCriteriaVariables().
3. Close the Destination selection Pass-through , select Scripts.
4. Scroll down to LAC Functions and double-click on setCriteriaVariables().
5. Scroll to the line where var runOutFile is set. Variable runOutFile will only be true if the jobInfo OutStorageType is FileSystem, the job is not a printOut, the file is a PDF, and both OutFileStorage and OutFilePath are not empty. All these conditions are met with the setups carried out in Lasernet Connector.
6. You can verify the value for runOutFile in the Lasernet Monitor.
If runOutFile is true, the job is sent to the OutFile module and jobInfo OutFilePath is used as the Directory Path.
7. To verify files are being sent to the proper Directory path, navigate to the directory path. The file is saved.
How to stop XML from being saved in the File Output Folder with a PDF
There are two ways to avoid having an XML file saved in the File Output Folder with a PDF.
The first way is to disable Archiving. Follow these steps:
1. Open FO and navigate to Lasernet > Reports > Archive.
2. In the Archive field, select No.
The second way is to enable Archiving with Save XML disabled. Follow these steps to do so:
1. Select Default under the Archive field.
2. Toggle the Save XML to No.
Comment (1)