Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Insert table Version 13 (Net)

Группа действийAction group: Excel 

Описание

Действие записывает данные из переменной типа Таблица в заданную область активной страницы Excel книги.

Иконка

Image Removed

Параметры

Входные параметры  

Контекст                                                               Контекст действия для работы с Excel-документом

Имя столбца начальной ячейки                        Имя столбца начальной ячейки, в которую будет помещена верхняя левая ячейка таблицы.

Индекс столбца начальной ячейки                   Индекс столбца начальной ячейки, в которую будет помещена верхняя левая ячейка таблицы.

Строка начальной ячейки                                  Строка ячейки, в которую будет помещена верхняя левая ячейка таблицы.

Таблица                                                                Переменная типа DataTable с данными.

С заголовком                                                       Если значение «true», заголовок таблицы будет вставлен в документ вместе с ее строками.

Настройки

...

Свойство

...

Описание

...

Тип

...

Пример заполнения

...

Обязательность заполнения поля

...

Параметры

...

Контекст

...

Контекст действия для работы с Excel-документом

...

Robin.Excel

...

Контекст excel

...

Да

...

Имя столбца начальной ячейки

...

Имя столбца начальной ячейки, в которую будет помещена верхняя левая ячейка таблицы. Если поле не заполнено, то берется значение из поля «Индекс столбца начальной ячейки».

...

Robin.String

...

Нет

...

Индекс столбца начальной ячейки

...

Индекс столбца начальной ячейки, в которую будет помещена верхняя левая ячейка таблицы. Если поле не заполнено, то берется граница используемой области.

...

Robin.Numeric

...

Нет

...

Description

The action writes data from a variable of type Table to the specified area of the active Excel workbook page.

Icon

Image Added

Parameters

Input parameters  

NameDescription
ContextAction context for working with an Excel document
Start cell column nameThe column name of the initial cell in which the top left cell of the table will be placed.
Start cell column indexThe column index of the initial cell in which the top left cell of the table will be placed.
Start cell rowThe cell row in which the top left cell of the table will be placed.
TableA variable of Table type with data.
With headingIf true, the table header will be inserted into the document along with its rows.

Settings

Property

Description

Type

Example of filling in

Obligatory to fill in the field

Parameters

Context

Action context for working with an Excel document

Excel instance

Excel context

Yes

Start cell column name

The column name of the initial cell in which the top left cell of the table will be placed. If the field is not filled in, the value from the " Start cell column index" field is taken.

String


No

Start cell column index

The column index of the initial cell in which the top left cell of the table will be placed. If the field is not filled in, the border of the used area is taken.

Numeric


No

Start cell row

The cell row in which the top left cell of the table will be placed.

Numeric


No

Table

Variable of Table type with data

Table


Да

With heading

If true, the table header will be inserted into the document along with its rows.

Boolean

true

No

Special conditions of use

For the With heading parameter:

  • When set to "true", the action will write the header row of the source table into the document as the first row along with the rest of the main rows of the table. Example: the Studio specifies that the table has "Columns: 3; Rows: 2", when inserted into the document, 3 columns and 3 rows will appear filled in.
  • If "false", the action will write only the main rows with the contents of the source table into the document. Example: in Studio, the table "Columns: 3; Rows: 2", when inserted into the document, 3 columns and 2 rows will be filled in.


Target tableTable after insertion without checkbox "With header" checkedTable after insertion with checkbox "With header" checked

Image Added

Image Added

Image Added

Example of use

Task

There are 2 Excel documents "Test" and "Test1". You need to take a table from the "Test" document and paste it into the "Test1" document starting from cell A3.

Image Added

Solution

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

Implementation

  1. Assemble a robot scheme consisting of actions:
    image2024-1-16_16-42-53.pngImage Added

  2. Configure parameters for the "Open" action. In the "Path to file" field, specify the path to the required Excel file. Check the Open Visible = true checkbox to display robot actions on the screen. 
    Image Added

  3. Set up parameters for the "Get 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. 
    Image Added

  4. Configure parameters for the "Open" action. In the "Path to file" field, specify the path to the required Excel file where the table should be inserted. Check the Open Visible = true checkbox to display robot actions on the screen. 
    Image Added

  5. Set up parameters for the Insert Table action. In the "Context" field specify the context of the opened document, in the "Initial cell column name" field specify - A, in the " Start cell row" field - 3. In the "Table" field specify the previously created variable "Table" with data. 
    Image Added

  6. Customize parameters for the "Save" action. In the Context parameter specify the context of the Excel document where the table with data will be inserted. 
    Image Added

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

Result

The program robot completed successfully. 

Image Added

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

Image Added

Additional

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

...

Строка начальной ячейки

...

Строка ячейки, в которую будет помещена верхняя левая ячейка таблицы.

...

Robin.Numeric

...

Нет

...

Таблица

...

Переменная типа DataTable с данными

...

Robin.DataTable

...

Да

...

С заголовком

...

Если значение «true», заголовок таблицы будет вставлен в документ вместе с ее строками.

...

Robin.Boolean

...

true

...

Нет

Особые условия использования

Для параметра "With heading":

  • При значении "true", действие запишет в документ строку заголовка исходной таблицы в качестве первой строки вместе с остальными основными строками таблицы. Пример: в Студии указано, что в таблице "Столбцов: 3; строк: 2", при вставке в документе окажутся заполнены 3 столбца и 3 строки.
  • При "false", действие запишет в документ только основные строки с содержимым исходной таблицы. Пример: в Студии указано, что в таблице "Столбцов: 3; строк: 2", при вставке в документе окажутся заполнены 3 столбца и 2 строки.

...

Image Removed

...

Image Removed

...

Image Removed

Пример использования

Задача

Существует 2 Excel - документа "Test" и "Test1". Необходимо взять таблицу из документа "Test" и вставить ее в документ "Test1" начиная с ячейки А3.

Image Removed

Решение

Воспользоваться действиями "Открыть", "Взять таблицу", "Вставить таблицу", "Сохранить". 

Реализация

...

Результат

Робот отработал успешно. 

Image Removed

В документ "Test1" вставлена таблица начиная с ячейки А3. 

Image Removed

Дополнительно

Результат вставки текста в файл при указанном чек-боксе "With heading" у действия "Вставить таблицу"