Working on a project to insert a datatable into a Word Doc template. I don’t need the headers from the datatable variable.
I have tried a few methods and just want to ask if anyone has tried this before.
My thought process is to write the table to an Excel doc, read it back in without the headers then insert Word. It’s a workaround but I’m wondering if someone might have a better way to do this.
Hi tsorel5405, welcome to the community,
What action are you using to insert the datatable?
I am using the Word Activity Insert Datatable
Good morning Tsorel,
You may be able to use the solution in this post to help solve your question:
just type this in the log:
string.join(Environment.NewLine, yourDataTable.Rows.Cast(of DataRow).Select(function(row) string.Join(",",row.itemArray)))
If still appears add .skip(1) before .select
I wish it helps and dont hesitate to mark it as a solution if it works…
welcome to uipath community
we can use INSERT DATATABLE activity inside the WORD APPLICATION SCOPE
for that go to design tab and manage packages and in official tab search and install UiPath.Word.Activities
–to read the datatable without headers while reading itself with READ RANGE uncheck ADD HEADERS property in the property panel
–then use a remove datarow activity where mention the row index as 0 and mention the datatable name as well
–followed by use these set of activities
–once after installing we can use these set of activities
I am already using that activity. I was looking for a way to use it without the headers being inserted as well.
For example what the results are after using Insert DataTable:
Worst case you can always do the following:
Write your datatable to Excel with the AddHeaders value unchecked
Read Range to get the datatable without the (real) header row
Write the new datatable to MS Word
did we try this buddy
Thank you for laying that out. What you did make sense and thank you for the help.
Glad it helped, and thanks to
@chenderson for the link
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.