Documentation/Device setup

For administrators

Column settings

The structure of tables_columns.xml, table layouts and how to apply column settings on a device.

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.

ElementValuesPurpose
displayNameTextColumn title on screen. Defaults to column name if omitted.
visibletrue, falseShow or hide the column. Default: true.
widthPositive integerColumn width, adjusted for screen density. Default: 100.
stretchabletrue, falseStretch the column to fill available space. Default: false.
wrap_texttrue, falseWrap long text within the column. Default: false.
from_new_linetrue, falseStart displaying the field on a new line within the record. Default: false.
align0, 1, 2Alignment: 0 — left, 1 — center, 2 — right. Default: 0.
type0, 1, 2, 3Display format: 0 — text, 1 — integer, 2 — decimal number, 3 — date. Default: 0.
decimalScaleNon-negative integerDecimal 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 attributeWhere it is used
ref_productsProduct reference.
ref_customersCustomer reference.
routesRoutes.
doc_ordersOrders journal.
doc_invoicesPayments journal.
doc_storechecksStore-checks journal.
doc_debtsDebts journal.
doc_orders_productsOrder lines.
doc_storechecks_productsStore-check lines.
doc_debts_productsDebt 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

  1. Place the file named tables_columns.xml directly in the outbox directory configured for the device.

  2. 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"/>
    
  3. On the device, run Download exchange file, followed by the Завантажити налаштування (Download settings) profile. If you changed the profile's view attribute, use that name.

  4. Check the exchange log on the device: the file should be installed without errors.

  5. Open Settings → Reset table settings, select the required tables and confirm the reset.

  6. 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.

SymptomWhat to check
The file was not downloadedThe exact filename tables_columns.xml, the device's outbox directory, and the file download profile.
Installation errorXML syntax, table names, column property names, and integer values without extra whitespace.
The file was installed, but the table looks the sameWhether you reset the settings of the intended table after downloading.
The reference changed, but product selection did notThe layout="multiselect" attribute and whether you selected product selection when resetting.
A column disappearedWhether the field exists in the downloaded table, and its visible value in the settings for this layout.