ScriptDirector
The ScriptDirector (PL/SQL) module creates PDF output which can be saved to the file system or stored in a database. It can also run PL/SQL scripts. The ScriptDirector was originally developed for use with Banner e-Bills, which uses a PL/SQL script to make individual PDFs of students’ bills available online.
Both Directors allow you to use a script to direct the output. The ScriptDirector allows only PL/SQL scripts to be used, whereas any type of script that can be run on your server can be used with the ImagingDirector.
Configuring ScriptDirector
For information on the Execute this Director section, please see the FormDirector page.
Select a copy to configure, then select Script from the list of Directors.
Configure the options in the Details section as follows:
- Break pages on - (Optional) Enter a string value to use as a page separator so that ScriptDirector parses the output file into individual files. A MapForm or CaptureForm variable can be entered, with a colon preceding the variable name. In this example, a purchase order number has been mapped with a floating field in MapForm, and is being stored into the :PO_Number variable. This variable will take on a different value for each PO, which makes it an ideal variable to “break” the input file into individual PDFs. Note how the colon before the variable name tells FormFusion that it is a variable and not plain text.
- Binary format - Select the output format for the file: None, Unformatted, or PDF.
- PDF output has additional options such as document information, encryption, and file compression.
- Unformatted prints the original input file. This is useful if you want to keep a record of the original input file.
- None results in no output. This allows you to run a script without producing an output file.
- Where will this file go? - (Optional) Specify a target location for the generated file. Use the browse icon to navigate to a location, or type the target location into the field. Indicate whether the path is in Windows, Host OS, or out-of-network using the drop down above the field.
- Select Path is in Windows to save the files on the MAP server or to a network location. If you specify the C: drive, this is the local drive on the MAP server. The UNC (Universal Naming Convention) must be used for network paths (\\\\ServerName\\Folder\\:MyFileNameVariable).
- Select Path is in Host OS to save files on the server where the host application (Banner, Colleague, or other calling program) is installed.
- Select Path is out-of-network to save files on a system running an external delivery service.
To generate one output file (do not break pages), leave the Break pages on field blank.
This example uses the PO number as the filename. It is also possible to create a filename and store it into a variable using CaptureForm. The query could populate the variable with the PO number, a text string, or any other data used to uniquely identify the record. Note that the file extension must be included at the end of the filename.
- Enter a file or server location - Enter the target location for the generated file.
- If you use the browse icon to navigate to a location, the path is converted and to the location is selected automatically.
- For any Windows paths, backslashes must be escaped by a second backslash.
- You may use a variable as any part of the filename or path.
- The filename must include the appropriate extension.
- Associated Data Connection - Select the Data Connection from this list.
- Script - (Optional) Enter a PL/SQL script that will execute for each page of the input file. In the case of e-Bills, this script is what updates the Banner tables with the PDF output files or file locations.
- For more room to edit, you can click the double arrow above the scroll bar to increase the size of the Script box. The other fields in the Details section will be hidden until the double-arrow is clicked again to minimize the Script box.
- Selecting the button changes the behavior of the Tab key so that it will insert a Tab character into the Script box instead of tabbing out of the box.
- Delete file after script completes- If using a PL/SQL script that copies the output files to another location, check this box (next to “Copy generated files to”) to remove the PDF file from the original location.
Troubleshooting ScriptDirector
If you are not receiving the expected output, check the following:
- Is the “binary format” drop down set to PDF? If it is set to “none”, FormFusion will not produce any output.
- If there is no output at all, remove the “break pages on” during initial testing to make sure the rest of the settings are OK.
- Make sure that the “copy generated files to” field has a valid path. The directory must already exist.
- Is a filename specified at the end of the path?
- Is the correct radio button selected for the specified location?
- Check the direction and number of the slashes or backslashes. Remember to escape all backslashes with a second backslash for Windows paths.
- For network locations, the MAPS service user must be able to view and save files to this directory. MAPS administrators can check to see what user the service is running as, and then try logging in to Windows as this user to see if the user is able to copy a file to the directory manually.
- Try specifying the full path to the remote location, including the drive letter.
- If testing a script or saving files back to the host OS, make sure that the job is being run from the host system/calling application, and not via the Test Print Template feature in FormFusion. When doing a test print, the job is run directly from the MAP server, so there is no “host” for it to send data to.