Inserting Data Table into Word Document

Hi all,

I have a scenario where I need to insert a Data table in Word document… But when I try to insert the table, the data is going to second page… but the table is not that big it has only two rows…

Please help me with how to get the data in same page…

TIA

@Anil_G , Can you please help on this

Are you inserting only datatable ?

is this new word document you are using to insert or is it already with some data in it?

can you please provide some samples how you have implemented the logic and also if possible provide sample files

regards

@LAKSHMI_NARAYANA_PEMMASAN ,

Yes I am inserting only datatable
and the word document is actually a invoice… It is a PDF am converting pdf to word and inserting datatable and again saving back to pdf

got it can you check manually when you opened the pdf document with word are you able

find empty space after the text ?

@MEGHA_cs

Try using read text first…and get the data from word document

Then trim the text str.Trim and write the data to word document then use add table activity

That way any extra spaces or data would be removed

Cheers

@LAKSHMI_NARAYANA_PEMMASAN ,
Yes there is a empty space, but manually also when I am copying its going to second page

Thanks @Anil_G , But Not working…

Any other solution?

@MEGHA_cs

Can you please send a sample please…that way we can see what the issue is

Or alternately try keeping a placeholder for table and use replace to insert the table at that position

Cheers

@Anil_G , I cannot share the sample…
Let me try…

Meanwhile help me on “How to add values in DT, row values of a column to get total sum , where as the Values contain special characters”

My column values for 1st row is: $ 400.00
column value for 2nd row is:$ 500.00

Am reading excel file with “Preserve Format” , because I want all the symbols in output

@MEGHA_cs

Please try this

dt.AsEnumerable.Sum(function(x) Cdbl(x("ColumnName").ToString.Replace("$","")))

cheers

1 Like

Thanks @Anil_G , its working

1 Like

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