This How-To has been marked as advanced. It assumes you have a good knowledge of the products and technologies discussed.

Rarely, the data that is returned from a DSD and it intended to go into a Word document may result in an issue in the Word document being generated. When this happens, you may see an error such as the following appear when you go to open the generated document:

howto_180314_01

Here’s how you can find out what is going on within the document. You will need to save the DOCX output to your machine, rather than opening it directly, and you will need fDocs Designer and fTest available.

Step 1: Identifying the problem

From the error message above, click the “Details” button and you’ll be told where the problem is occuring. Most likely, the problem is in the document.xml file within the DOCX, and a line and column will be shown.

howto_180314_02

Step 2: Opening the output using fTest

Open fTest, and go to the File menu and select “Examine fDocs Template”, then select the outputted DOCX file you saved to your machine. The template analyser will appear, and we are interested in the first tab, which shows the document XML as reported in the error. Now, we need to find the line the error is occuring on. Right-click within the document XML and select the “View Source” option to open the contents in notepad, then from the Edit menu select “Go To”, and enter the line the error is occuring on – in this case, line 2584.

Step 3: Identifying the cause of the problem

Here you’ll need to use your detective skills to some extent to identify the cause of the issue. In our case here, we have a bad Word Table Row (identified by the w:tr) that doesn’t have any content. This isn’t allowed in Word, so lets try and find out what could be the cause of the issue.

howto_180314_03

Above the part of the bad document, we can see some text on the row directly above (see the section that says “Client Telephone Number”). So, let’s go into the template that is responsible for the document and see where we have “Client Telephone Number” and see what’s happening at that point.

Step 4: Fixing the template

In this case, we can see that the Client Telephone Number is a tag on its own in a table row.

howto_180314_04

By looking at the data source, we find that the client has no telephone number, and the database is returning “Null” as the value for that field, therefore fDocs is substituting “null” as the row, and Word does not allow this. There are  a number of possible outcomes to rectify this:

  • Put a compare tag around the field to say “No Telephone Number recorded” if there is no telephone number
  • Add some content, such as a space after the tag, so that if there is no data the row in Word still has a space character and this isn’t “null”

Step 5: Re-publish the template

We can now republish the template and the fix has now been applied.

 

 

image_pdfimage_print