Adding header to Excel using Extracted Data Table - Data Scraping

Hello.
I’m using DataScraping so there is automatically generated ExtractedDataTabe.
How to say to write range activity by using this ExtractedDataTabe asInput and add to excel header?

I try before the DataScrap to use Build Data Table as output ExtractedDataTabe.
There I make my columns DocNo, PL, CustNo.

But for some reason write range activity don’t use my columns.
The result was:
Capture

Thank you in advance.

is ADD HEADERS property enabled in the write range activity
Cheers @Veselin_Ganchev

What is the range you are providing in the write range activity @Veselin_Ganchev?

@Palaniyappan
I enable him. But there is nothing change except that Header is there as you see on the image.
If I disable him. The Header is not there, but the range of the data is on the same spot on as the image.

@HareeshMR
Write range is “”.

Fine
you mean like you want to get the values from data scrapping method and use the header of the already existing excel
right…?
if so we can use APPEND RANGE activity where in input mention the datatable variable and it would append to the existing excel
but ensure that the number of columns and order of columns are same in excel and in the data scrapping
else we need to add each row through FOR EACH ROW loop by pass the extracted datatable as input and inside that loop use ADD DATA ROW activity where in the arrayrow property mention as {row(0),row(1),row(2)} and in the datatable mention the datatable created from build datatable activity
–and by that way it will add and then we can use WRITE RANGE activity with add headers enabled

Cheers @Veselin_Ganchev

yeah, will give you a complex solution for this,

  1. Get the column count as ExtractedDataTable.Columns.Count and then use the below line to convert it to a alphabet

     StrColumn = Convert.ToChar(64 + c)
    
  2. Use Get row count as ExtractedDataTable.Rows.Count and store as row count

  3. Then provide the range as “A2:”+StrColumn + rowCount.tostring which will write from the second row

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.