Insert the table Version 1 (Python)

Action group: Office


Description

The action inserts the table into the document

Action icon

Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextThe context of the action for working with the ods/xlsx table.Robin.OpenSheetD oc
Yes
TableThe table to be inserted.Robin.DataTable
Yes
Name of the initial cell columnThe name of the column of the initial cell in the document where the upper-left cell of the specified table will be inserted. If the field is not filled in, then the value is taken from the field «Index of the column of the initial cell».Robin.String
No
Index of the initial cell columnThe index of the column of the initial cell in the document where the upper-left cell of the specified table will be inserted. If the field is not filled in, then the border of the used area is taken.Robin.Numeric
No
The row of the initial cellThe row of the cell in the document where the upper left cell of the specified table will be inserted.Robin.Numeric
No
With the titleIf the value is «true», the table header will be inserted into the document along with its rows.Robin.BooleantrueNo

Special conditions of use

The action inserts a table into a tabular document.

  1. To insert a table in a certain place of the document, the user should specify the row and column of the cell where the upper left cell of the specified table will be inserted.
  2. If the user does not specify the row and column of the cell, the table will be inserted in the border of the used area of the document - in the upper left cell of the used area of the document.
  3. To identify a column, the user can specify a column name or index.
  4. If the column name is not filled in, the value from the column index parameter is taken.
  5. If the column name is filled in, the column index is ignored.
  6. If an invalid column name/index is specified, the action will generate an error. Error description: "An invalid column is specified.".
  7. If an invalid row is specified, the action will generate an error. Error description: "An invalid row is specified.".
  8. If a row is specified but no column is specified, the top left cell of the table will be inserted into the first column of the area used and the specified row.
  9. If a column is specified but no row is specified, the top left cell of the table will be inserted into the first row of the area being used and the specified column.
  10. The user can insert the table with or without a header. If with a header, both the header and rows of the specified table will be inserted into the document. If without a header, only the rows of the specified table will be inserted into the document.

Example of use

Task  

There are 2 tabular documents "Test 1" and "Test 2". It is necessary to take the table from the document "Test 1" and insert it into the document "Test 2" starting from cell A3.


Solution

Use the actions "Open", "Take table", "Insert the table", "Save". 

Implementation

  1. Assemble a robot scheme consisting of actions:


  2. Set parameters for the "Open" action. In the "File path" field specify the path to the required tabular document.



  3. Set parameters for the " Take table" action. In the "Context" field specify the context of the opened document, create a variable of the "Table" type to which the data will be written and specify it in the "Result" field.  Leave the other fields empty, because it is necessary to take the table completely.



  4. Set parameters for the "Open" action. In the "File path" field specify the path to the required tabular document where the table is to be inserted. 



  5. Set up parameters for the "Insert the table" action. In the "Context" field specify the context of the opened document, in the " Name of the initial cell column" field specify - A, in the "The row of the initial cell" field - 3. In the "Table" field specify the previously created variable "Table" with data.



  6. Set parameters for the "Save" action. In the "Context" parameter specify the context of the tabular document in which the table with data will be inserted.



  7. Launch the robot using the "Start" button in the top panel.

Result

The program robot completed successfully.

A table starting in cell A3 has been inserted into the "Test 2" document.

 

Additionally

The result of inserting text into a file when the "With header" checkbox of the "Insert table" action is selected.


  • Нет меток