How to use table command?
The table command accepts one value: xml file location. The file has to be constructed using a special format. The file should have information for how to view the table online as well as how and what to print (on pdf page).
To add a table, create a new block and add a custom property: table. The value would be a relative path to the xml file (starting with ~). A good location for such files is the Company Assets, so the location would be: ~/Storage/ProducerID/CompanyID/0/Assets/Documents/table.xml
The exact path can be copied from the company assets dialogue.
The location of the table on the page is bound by the dimensions of the block containing it.
The root node of the xml file is the table node, it has three child nodes: title, subtitle, body and footer.
The table node has the following attributes:
caption="My Title" Table caption, appears online only
noofrows="10" no of initial rows to appear online
maxrows="20" max no of rows per table
shownewrow="true" Allow/disallow adding new row by user
maininputwidth="219" Online Control width
cssstyle="background: #F0F0F0;" Online css style of the table
backcolor=""
framelinewidth="2" PDFLib: Border table frame width
otherlinewidth="1" PDFLib: Inside frame widths
showtitle="true" Ask or not user for title
showsubtitle="true" Ask or not user for subtitle
showfooter="true" Ask or not user for footer
printheader="true" print/ do not print table header
The title node is also optional, if added, a textbox is created online to enter a table title. The title node provides the following attributes:
label=”Title Label” Online Title Label
value=”Default Text” Default text for title
fontname="" PDFLib fontname
encoding="" PDFLib encoding: winansi, builtin…
color="" PDFLib Colouring: {cmyk 0.1 0.1 0.1 0.9}
backcolor="" PDFLib Colouring: {cmyk 0.9 0.9 0.9 0.1}
align="left" left, right, center
valign="center" top, bottom, center
A default text can be added too.
The subtitle node has the same attributes as title and prints below it.
The footer node has also the same attributes as title but prints below the table.
The body node contains all the table details, it has one main child: rows that have the following children: headerrow, row and data.
Headerrow defines the column headers. It can have any number of headercell nodes. A headercell node has the following attributes:
fontname="Helvetica"
encoding="builtin"
fontsize="12"
color=""
backcolor=""
align="center"
valign="
center"
colwidth="”
The value of the node would be the header text.
The row node has exactly the same number of cell children as there is headercells. The attributes of the cell node are:
fontname="Helvetica"
encoding="builtin"
fontsize="12"
color="rgb 0.5 0.5 0"
backcolor=""
align="left"
valign="center"
readonly="false"
There can be any number of row nodes, the default is one (one record per row), but if required more rows can be added to identify one record. If two rows were defined then adding a new row by the user will automatically add two new rows for data entry.
The Data node is optional and it is used to fill default or sample text. The data node has any number of datarow nodes as children. Each datarow should have exactly the same number of datacell nodes as there are children nodes in headerrow or row nodes.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article