Home Search

DriveWorks Pro 22
How to: Create and Install a Form Template

Send Feedback

How to: Create and Install a Form Template

This topic shows how to create a Form Template and install it to be used for other Projects and users.

Form Templates are useful for creating a familiar UI across multiple Projects.

Using consistent layouts for user forms ensures an organized and professional image that customers recognize and find user-friendly.

A Form Template has the file extension of .drivefort

Create a Form Template

Follow the steps below to create a Form Template.

With the Project containing the Form to be exported open in DriveWorks Administrator:

  1. Navigate to Stage 2: User Interface>Form Design, and select the Form to be exported.

    Multiple Forms can be selected by holding the Ctrl key while selecting.

    A Form can also be exported from the Form Navigation Task.

  2. Ensure the current Form meets the requirements for the template.
  3. Click Export Form As Template from the Command Bar, the Template Exporter will launch.
  4. In the Template Exporter enter a Title, Description and Save Location for the template, click Next.

    Once the template has been installed, the Title will be displayed as the Template name in the Template list, of the Load Template dialog.

  5. Select the Constants that are required for the Form. Click Next.

    To select all, right click on a Constant and choose Select All.

  6. Select the Variables that are required for the Form. Click Next.

    Variables will be displayed in Categories (if used), categories can be expanded or collapsed from the right click menu.

    To select all, right click on a Constant and choose Select All.

  7. Select the Simple Tables (Group Tables, Excel, ODBC, SQL or Roll Up Tables cannot be included with Form Templates) that are required for the Form. Click Next.
  8. Select the Calculation Tables that are required for the Form. Click Next.
  9. Select the Specification Macros that are required for the Form. Click Next.
  10. Select any Additional Content that are required for the Form. Click Next.

    Browse to the Source Location of the additional content, once selected all folders and files will be displayed.

  11. Enter a File Name for the template and browse to a location to save. Click Save.

Add an Image to the Index File

A default image is included with the template created above.

Images can be included in the index.html file by encoding them to base64.

Use a Web Service such as Base64 Image to convert an image to base64.

Once you have the base64 code of the image:

  1. Using Windows Explorer locate the Form template created above.

    Rename the file extension from .drivefort to .zip

  2. Extract the zip file (from Windows Exlorer, right click and select Extract All).
  3. In the folder created from the extraction, open the Description folder.

    Open the index.html file in an editor (Notepad for example).

  4. Replace the text INSERT BASE64 HERE below with the base64 code, obtained from the Base64 Image Encoder service used:

    The line <p>Use <a href="https://www.base64-image.de/">base64</a> to display an image.</p> is for reference only, and can be removed.

        <body>
            <h1>Form Template Title</h1>
            <p>Form Template Description</p>
            <p>Use <a href="https://www.base64-image.de/">base64</a> to display an image.</p>        
    
            <img src="INSERT BASE64 HERE" />
    
        </body>

    Ensure the quotes around the base64 code are included.

  5. In the template folder you will now have the following items:
    • File - TemplateFileName.xml (this will be the name (not the Title) given to the template when it was exported).

      The name of this file is important for the next step.

    • Folder - TemplateFileName

      This could be empty, depending on the selections made when creating the template.

    • Folder - Description

      This contains the index.html file

    Select all items, right click and select Send To > Compressed (zipped) folder.

    It is important the zip is created this way so the contents are not placed within a sub folder.
  6. Rename the zip file.
    • The name of the zip file is required to match the name of the xml file that has the TemplateFileName (see the previous step).
    • The extension of the zip file is required to be changed to .drivefort.

Installing a Form Template

If a template is not displaying in DriveWorks after being installed, check that the installer or version of DriveWorks is the one currently being used, as templates are version specific.

A template file will not display if there are errors within its data.

  1. Double click on the new .drivefort file and the DriveWorks Install Template wizard will automatically launch.
  2. Choose whether this template should be made available to either the Current User or for Everyone (who has access). Click Next.

  3. The DriveWorks Install Template wizard will then launch and complete the task to install the template for the

    users selected.

Uninstall a Form Template

To uninstall a Form Template please follow the steps below:

  1. Open Windows Explorer and navigate to the folder where "Templates" are stored in DriveWorks.

    See Form Template File Location

  2. From the "Forms" folder, select the template you want to uninstall.
  3. Right-click and select "Delete" or press the "Delete" key on your keyboard.

The selected Form Template will no longer appear in the list of available templates when following the steps to Load Template (restart of DriveWorks maybe required).