This article discusses one way to use the DREL document to create a customized Word document containing your form data. You can make it look exactly like your paper forms at need while maintaining the ease of data collection with our app.
DREL is a ProntoForms-specific language that is used to reference data in submitted forms (data records). It can be used to build a string using properties from form submissions, including answers. Read here for full details of the properties that DREL can reference.
A number of other document types are available, and multiple documents can be sent with a single form submission. Read more about documents here.
- In Microsoft Word, create a Word document that matches the desired output and design for your document.
- Using DREL, map the data from your forms.
- In Word, go to File -> Export -> Change File Type -> Save As. Choose "Word 2003 XML Document" as the file type. If you have questions that contain images (i.e., use the device's camera), please look at: Using Images in your Custom Word Document
- Look at your new XML document in Word, and correct any formatting issues that happened during the conversion. Save it again if you make any changes.
- Find the XML file in the folder you saved it in. Right click on it, then choose Open with -> Notepad (or any other plain text editor).
- In the plain text editor, right click, choose Select all and copy all the text.
- Create the document in the web portal and navigate to the Configuration tab.
- Paste the copied text in the ProntoForms DREL document "template" box.
- Enter "doc" (without "." in front of it) in the File Extension field.
- Enter "application/msword" in the Content Type field.
- Select Create at the bottom of the screen.
- Preview using the form whose question labels you mapped into the template. It should open in word, with sample data mapped into it.
Non static images are images that may change depending on the form submission. This means that any question that:
- is mapped in the document, and
- uses a Camera or Sketchpad control
will need to use the following steps to correctly display your images:
- Before you save the document as an XML file, (Step 3 above), use a placeholder image where your desired image should be.
- Save the file as an XML file. Do not open it in Word. If you wish to make further changes after saving the file as an XML file, use a plain text editor.
- Open the XML file in Notepad or any other plain text editor. You will see your image encoded in base64, which will look something like the following:
<v:shape id="Picture 1" o:spid="_x0000_i1026" type="_x0000_t75">
- Replace the entire Base64 string with %a[example_label][bytes]. Save your work and return to step 6 above.
Note: This method limits you to one picture per question label. This means that if you have multiple attachments in a question (i.e. multiple pictures in response to a question), only the first will come through.