Skip to main content
1-Visitor
May 17, 2018
Question

Gateway export MS Word: avoid empty lines between table rows?

  • May 17, 2018
  • 2 replies
  • 7637 views

Hi,

I want to export items into a table (MS Word), where each item is one table row. The problem is, that there remains an empty line between the rows, which has to be deleted manually. We are using ILM 11.2.

 

The release notes of ILM 11.0 says, that following issue was solved:

HF-S150000000-016 CS241475 A line break is inserted between table headings and table content when a document is  xported from Gateway to MS Word.

 

According to CS243266 I am using the following property:

<property name="ensureLineBeforeAndAfterTable">false</property>

 

Since it is necessary to put the gateway commands between the rows, I need to split the table in the export template:

 

ID

Revision

Category

Assigned User

<%beginContent%>

<%beginLevel%>

<%{ID}%>

<%{Revision}%>

<%{Category}%>

<%{Assigned User}%>

<%endLevel%>

<%endContent%>

 

The result looks like this:

ID

Revision

Category

Assigned User

 

9345

0.1

SW Specification

John Doe

 

9374

0.3

SW Specification

John Doe

 

When empty lines are deleted manually Word puts them together as one single table. Is it somehow possible to avoid those empty lines??

 

Thanks!

2 replies

17-Peridot
May 17, 2018

This is a very well known feature 🙂

Usually its caused by different formatting in your table definition.

To solve it, select all elements in Word and press Ctrl+Blank. This will reset any selected text and the table to the "Normal" style. Finally, the "empty" lines are gone.

  

nxpet1-VisitorAuthor
1-Visitor
May 18, 2018

Hi, unfortunately it didn't help in my case. I tried what you suggested. I even started with a new empty Word template (using Word 2013). The best I can get now is this:

 

ID

Revision

Category

Assigned User

9345

0.1

SW Specification

John Doe

 

9374

0.3

SW Specification

John Doe

 

So no empty line between table head and the first row. But between the content rows the empty line remains. Any other ideas what to do or why this happens? Do you have a working Word template that you can provide, so that I can try it out on my PC?

1-Visitor
May 18, 2018

Have you tried this (in addition to different formatting bug)?

 

<%beginContent%><%beginLevel%>

<%{ID}%>

<%{Revision}%>

<%{Category}%>

<%{Assigned User}%>

<%endLevel%><%endContent%>

1-Visitor
June 8, 2018

We have a pretty complicated export that we do to Word that involves a custom post processor that we've created. We run into the same issue where we make an insignificant change to the template but it completely breaks the export. It ends up being due to Word adding something to the XML that's not necessarily visible in Word itself. One trick I use is unzipping the docx file and then opening up the document.xml file to search for any strange formatting that shouldn't be there. We also have templates we use that kick out individual table rows that Word will merge upon opening it.

 

I often have to go to the XML directly to clean up templates. After you've done it a few times it gets pretty straight forward. Not sure if this will help you or not but I figured I'd post this just in case since it sounds like you're running into the same issues as us.

nxpet1-VisitorAuthor
1-Visitor
June 12, 2018

Hi @nborrerojr.: Thanks for your hint. I compared the XML of a working template with one version that doesn't (I just changed the color of a "command-only" line). At the first glance I couldn't find anything, that causes the behaviour. But I am not quite sure, since I am not familiar with this Word XML.

 

Anyway, I think I found out, that the Word 2013 causes the behaviour. Yesterday I had the chance to test at home with my Word 2016. I took a template, that had those problems and opened it in Word 2016. First I went back to the normal formatting styles by using "ctrl + space". Then I reformatted everything and I also applied coloring to the "command-only" lines. This only resulted usually before in empty lines. The result was as expected, there were no unwanted (=colored) empty lines anymore.

 

I did two quick check with two templates with Word 2016. Both worked well without empty lines. So from this first quick test it seems, that Word 2013 caused this behaviour. I will ask company IT for the Word 2016 version and will do more testing afterwards. But for now I think this solves my problem.