On this page
tables_columns.xml defines how columns appear in reference lists, journals and document table sections in the Android application. The integrator prepares the file and places it in outbox for transfer to devices.
File structure
The root element is <tables-columns>. Each <table> identifies a table and its layout. Nested <column> elements define the columns in the desired order.
The file's actual encoding must match the encoding value in the XML declaration.
This example shows three columns in the product reference: code, name and retail price.
<?xml version="1.0" encoding="utf-8"?>
<tables-columns>
<table name="ref_products">
<column name="code">
<displayName>Code</displayName>
<width>80</width>
<visible>true</visible>
<type>0</type>
</column>
<column name="name">
<displayName>Name</displayName>
<width>200</width>
<stretchable>true</stretchable>
<wrap_text>true</wrap_text>
<type>0</type>
</column>
<column name="price_Retail">
<displayName>Price</displayName>
<width>90</width>
<align>2</align>
<type>2</type>
<decimalScale>2</decimalScale>
</column>
</table>
</tables-columns>
column name must match a field name in the corresponding table. For example, use price_Retail only if the product reference has a field with that name.
For each table and layout pair, the file replaces the entire set of default column settings. List the columns you want to configure. The application may add table fields omitted from this set to the view with default settings. To hide a field, set visible=false for it. Tables not listed in the file keep their settings.
Column properties
Element names are case-sensitive: use exactly displayName and decimalScale.
| Element | Values | Purpose |
|---|---|---|
displayName | Text | Column title on screen. Defaults to column name if omitted. |
visible | true, false | Show or hide the column. Default: true. |
width | Positive integer | Column width, adjusted for screen density. Default: 100. |
stretchable | true, false | Stretch the column to fill available space. Default: false. |
wrap_text | true, false | Wrap long text within the column. Default: false. |
from_new_line | true, false | Start displaying the field on a new line within the record. Default: false. |
align | 0, 1, 2 | Alignment: 0 — left, 1 — center, 2 — right. Default: 0. |
type | 0, 1, 2, 3 | Display format: 0 — text, 1 — integer, 2 — decimal number, 3 — date. Default: 0. |
decimalScale | Non-negative integer | Decimal places for type=2. Default: 2. |
Column order follows the order of <column> elements in the file. You do not need to set position. type changes the display format, not the data type in the source XML table.
Tables and layouts
Value of the <table> element's name attribute | Where it is used |
|---|---|
ref_products | Product reference. |
ref_customers | Customer reference. |
routes | Routes. |
doc_orders | Orders journal. |
doc_invoices | Payments journal. |
doc_storechecks | Store-checks journal. |
doc_debts | Debts journal. |
doc_orders_products | Order lines. |
doc_storechecks_products | Store-check lines. |
doc_debts_products | Debt lines. |
For product selection in an order or store-check, use ref_products with layout="multiselect":
<table name="ref_products" layout="multiselect">
<column name="name">
<displayName>Product</displayName>
<width>200</width>
<stretchable>true</stretchable>
</column>
<column name="doc_orders_products_count">
<displayName>Quantity</displayName>
<width>90</width>
<align>2</align>
<type>2</type>
<decimalScale>3</decimalScale>
</column>
</table>
This is a separate layout with its own columns. Place the fragment inside <tables-columns>. The same file can contain two <table name="ref_products"> elements: one without layout for the standard reference view, and one with layout="multiselect" for product selection.
How to transfer the file
-
Place the file named
tables_columns.xmldirectly in the outbox directory configured for the device. -
Add the file to a download profile in
exchange.xml. For example, add the following inside<get><files>in the existing Завантажити налаштування (Download settings) profile from the standard exchange file:<file name="tables_columns" files="tables_columns.xml"/> -
On the device, run Download exchange file, followed by the Завантажити налаштування (Download settings) profile. If you changed the profile's
viewattribute, use that name. -
Check the exchange log on the device: the file should be installed without errors.
-
Open Settings → Reset table settings, select the required tables and confirm the reset.
-
Reopen the table and check the column titles, order and formatting.
Downloading the file updates the default column settings. Resetting applies those defaults to the current table layout, replacing previous column customizations made on the device for the selected tables. For the layout="multiselect" example, select Select items for the Order / Store-check document.
If the appearance did not change
Start with the exchange log on the device. The mobile application reports errors importing tables_columns.xml.
| Symptom | What to check |
|---|---|
| The file was not downloaded | The exact filename tables_columns.xml, the device's outbox directory, and the file download profile. |
| Installation error | XML syntax, table names, column property names, and integer values without extra whitespace. |
| The file was installed, but the table looks the same | Whether you reset the settings of the intended table after downloading. |
| The reference changed, but product selection did not | The layout="multiselect" attribute and whether you selected product selection when resetting. |
| A column disappeared | Whether the field exists in the downloaded table, and its visible value in the settings for this layout. |
