Write range

This is used to write a collection of rows into the Excel sheet. It writes to the Excel file in the form of a data table. Hence, we have to supply a data table:

  1. Drag and drop a Build data table activity from the Activities panel. Double-click on this activity. A window will pop up. You will notice that two columns have been generated automatically. Delete these two columns. Add your column by clicking on the + icon and specify the column name. You can also select your preferred data type. You are free to add any number of columns:
  1. In this project, we are adding two columns. The procedure for adding the second column is almost the same. You just have to specify a name and its preferred data type. We have added one more column (Roll) and set the data type to Int32 for the data table. We have also initialized this data table by providing some values in its rows.

Create a variable of type data table. Give it a meaningful name. Specify this data table name in the Data table property of the Build data table activity. We have to supply this variable in order to get the data table that we have built:

Our data table has been built successfully.

  1. Drag and drop an Excel application scope inside the main Designer panel. You can either specify the Excel sheet path or manually select it. Connect this activity to the Build Data Table activity. Inside the Excel application scope activity, just drag and drop the Write Range activity:
  1. Specify the data table variable name that we created earlier and set it as a Data table property inside the Write Range activity. We can also specify the range. In this case, we have assigned it as an empty string:

That's it. Hit the Run button or press F5 to see the result.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.114.142