Bug in Write Range Activity: Empty DT is not writing Headers in the Excel

Hi,

Scenario: Write Range either workbook or Excel application scope doesn’t add headers of an empty datatable

Steps to reproduce:

Build an empty datatable with few columns headers. say Empid, empname, empcity
Not just write range this DT to an excel with AddHeaders activity selected.
It will generate a new blank Excel with excel name and sheet names whatever passed in the activity, but no headers.

Current Behavior: No headers are added to excel sheet if DT is blank or with 0 rows

Expected Behavior: it should atleast add the DT column names as headers to the write range activity of excel.

Studio/Robot/Orchestrator Version: 2019.5

Last stable behavior:NA
Last stable version:NA
OS Version: windows 7 64 bit professional
Others if Relevant: (workflow, logs, .net version, service pack, etc): NASampleTest.zip (11.1 KB)

Thanks

Hey @Anil_choudhary,

Please make sure add headers property is selected in write range property pane.

Create New File is unchecked in excel application scope.

Hi Thanks a lot for prompt response.

Did you executed the attached workflow?
If not please execute it once.
Please find it below

Thanks

SampleTest.zip (11.1 KB)

If you really need the headers you can put them as first row and write the table without the checked box for headers.
But i don’t think you need an excel if you don’t have at least one value to work on, so maybe it is not a “bug”.

1 Like

Thanks,

But this workaround is implemented.
Not sure we should call it bug or not, but if the DT is there and the add headers is checked it should write the DT column names as headers in excel even if it doesn’t contains any data.

Thanks