.. highlightlang:: us .. index:: File=>Create Data-Table .. _file-create-datatable: File=>Create Data-Table ----------------------- This command displays the selected data channels in a table row or column wise. If the data cannot be displayed in one page extra pages are added. The number of pages is limited to 255. The function uses a template. .. image:: S:/uniplot-obj/images/IPW-Report.* To create a data table choose :guilabel:`File=>More File Functions=>Data Table: Arrange Data in columns or rows`. .. image:: S:/uniplot-obj/images/datatable-config-dialog-en.* .. us.dlgitem **NC File** Displays the loaded data file. (converted into NC format). Click the :guilabel:`...` button to set a record filter or edit the data. .. us.dlgitem **Template** Displays the template file name. The default templates are saved in the :file:`uniplot\\template` directory. Click on the :guilabel:`...` button to select another template. .. us.dlgitem **Repeat the following channels on each page (list separated by ,)** Insert the channel names separated by a comma. The names will be displayed on each page. .. us.dlgitem **Display All Channels** If this option is selected all channels are written to the document. If this option is not checked a channel selection dialog will be displayed. .. us.comment **Comment** All template pages will be copied into the new document. The last template page must contain a table with the name "Datatable_vertical" or "Datatable_horizontal". The last page will be copied as many times as necessary to display all data. The document can contain up to 255 pages. To set the table name right click on the table and choose "Configuration". See also :ref:`edit-objecttable-configuration`. .. list-table:: :header-rows: 0 * - Datatable_horizontal - Channels are displayed in rows. * - Datatable_vertical - Channels are displayed in columns. Pages can contain placeholders of the form "$Text$". The placeholder will be replaced with the attribute from the NC file. The channel name and unit is written above the data. The document pages are filled in the following order: The first table is filled with as many channels as the table contains columns or rows. The data is written to this page. If the data does not fit into the page extra pages are added, followed by pages for the remaining channels. The following templates are saved in the :file:`uniplot\\template` directory: :: datatable_A4_landscape_horizontal.ipw datatable_A4_landscape_vertical.ipw datatable_A4_portrait_horizontal.ipw datatable_A4_portrait_vertical.ipw datatable_letter_landscape_vertical.ipw datatable_letter_landscape_horizontal.ipw Table format: The template contains all format settings: number of rows and columns, number format, font, color, alignment, column width, etc. If a channel in the NC file contains the format attribute "C_format", the default cell format will be overwritten. The first column or row will display a record counter. Template with predefined channels ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Templates can be setup with predefined channels. Create Template ^^^^^^^^^^^^^^^ The table object must have the name "Datatable_with_channels". To set the name, right click on the table object and select :ref:`edit-objecttable-configuration`. The channel placeholder must be set either in a row or column. Each channel name starts and ends with an asterix, for example *speed*. The name is case sensitive. The following row or column can contain a format string. The decimal character is a period. Example: .. image:: S:/uniplot-obj/images/IPW-Report-Datatable_with_channels-Template.* Row 1: The first row contains the channel names. The names must not match the placeholders in row 3. This is only text to display. Row 2: The second row contains channel untist. This is only text to display. Row 3: The third row contains the channel placeholders. The placeholder will be replaced with the first data point. Row 4: The 4. row can contain a format text, for example 0000.00 set the format with 2 decimal places. The template can contain multiple pages. UniScript-Interface ^^^^^^^^^^^^^^^^^^^ Create an ic file with the following function and save the file with the tempalte in an directory. Specify the directory in :ref:`toolsmore-options`. :: auto_AddToUI("Daten-Tabelle", "Tabelle1", "MyTableReport1") def MyTableReport1() { ssTemplate = "datatable_A4_1.ipw"; ssNCFile = _DoFileImportDlg(); // returns the NCName or "" if (ssNCFile == "") { return FALSE; } upReport_Base(ssTemplate, ssNCFile); } def upReport_Base(ssTemplate, ssNCFile) { ssTemplate = _AUTO_FindFileInSearchPath(ssTemplate); o = upReport(); p = o.parameter; p.NCFile = ssNCFile; p.ssTemplate = ssTemplate p.bRecordFilter = TRUE; p.smPlaceholder = "" p.AddTohDoc = 0; // handle of document or 0: create a new document p.bHasPlaceHolder = TRUE; upReport_Make(o); } .. seealso:: :ref:`filemore-file-functions`, :ref:`filemore-file-functionssave-document-pages-as-a-pdf-file` :sub:`id-1080387`