Uipath中datarow类型的数据使用write range写入到excel
有时候,使用read range读出数据后,循环datatable,for each row循环的是每行数据,想把这行数据写入到某个表,但是好像没有写入行写入列的方法,后来经过一小时的查找,找到了以下两种方式:
一,使用代码方式将row转化为datatable,使用write range写入(简单方便)
(new DataRow() {row}).CopyToDataTable
exp:
二、使用Build DataTable创建一个空dt,然后把row添加进dt,使用write range写入
-
First create one DataTable using Build DataTable activity and then pass that DataRow to that DataTable using Add DataRow activity.
-
And then use Write Range activity to write into Excel file.
exp: