Tables - Conditional visibility on columns

Introduction

EDS Publisher allows the conditional formatting of elements inside a document, including dynamic tables. EDS Publisher has the ability to conditionally format columns in order to change the visibility property.

How to

In order to achieve the desired output we will need to use the XML View. Below are the steps to achieve the desired functionality.

1. From the Ribbon navigate to the View tab and from the Documents Views group select XML View;

2. Add the 'Conditional Formatting' property by using the <xfd:attribute-value> element:

<xfd:attribute-value object="myID" attribute="PropertyName" condition="myCondition" value="PropertyValue"/>

where:

  • object: is the id number that you will need to set on the element, in our example it will be the table column;
  • attribute: this is the Property Name. In this case, it should be: fo:visibility;
  • condition: this is the Condition. You need to add the condition used to hide the column;
  • value: this is the Property Value. In this case, should be set to 'collapse'.

3. After adding the attribute, you need to add the id on the column of the table that you want to be collapsed, like below:

<fo:table-column id="myId"/>

  • In the sample, we wanted to collapse the 'Year' column, if the @year=’1985’.
  • We used the following condition:

<xfd:attribute-value object="YearColumn" attribute="fo:visibility" condition="/ns:catalog/ns:cd/@year = '1985'" value="collapse" />

  •      Because we wanted to hide the 'Year' cell, which is the fifth column, we added the id="desired" on       the corresponding column, like below:

<fo:table width="auto" table-layout="fixed" >
<fo:table-column/>
<fo:table-column/>
<fo:table-column/>
<fo:table-column/>
<fo:table-column id="YearColumn"/>...

Attached you will find a sample created based on these instructions. If you have additional questions, please send an e-mail to our Support Team.

Have more questions? Submit a request

Comments

Powered by Zendesk