Michaeljep
(Michael Jeppesen)
January 3, 2022, 11:54am
1
Hi
I have a collection of strings that I write to a datatable, but I would like each item on a seperate line
The output at this point is like this
I would like to have the lines in seperate rows so that they are easier to read and compare
Here illustrated with red vertical lines.
Srini84
(Srinivas)
January 3, 2022, 12:00pm
2
@Michaeljep
Assign a variable and store the value in that variable as below
Datavariable(6) = DatatableVariable(6).ToString.Replace(" ", “-”)
Hope this may help you
Thanks
Srini84
(Srinivas)
January 3, 2022, 12:01pm
3
@Michaeljep
Sorry No need of Variable, just use assign and write as below
Datavariable(6) = DatatableVariable(6).ToString.Replace(" ", “-”)
so the replace value will be assigned directly to the column
that you can use use
Hope this may help you
Thanks
Hi @Michaeljep
use this syntax in assign activity inside for each row
Currentrow(6)=Currentrow(6).ToString.Replace(" ",Environment.newLine)
thanks,
Robin
Michaeljep
(Michael Jeppesen)
January 3, 2022, 1:32pm
5
I can’t get it to work, maybe it’s because of the way I’m adding the collection to the datatable.
I use String.Join to add the datarow to my datatable.
{CurrentRow.Item(“Fakturanummer”).ToString,Regnr,CurrentRow.Item(“Værkstedrapportnummer”).ToString,VærkstedsrapportTotalBeløb,TaksatorRapportNummer,TaksatorTotalBeløb,String.Join(" “,VærkRapportCollection),String.Join(” ",TaksRapportCollection)}
No matter if I add Environment.Newline in the Add To Collection activity or I use Replace(" ",Environment.newLine) when adding the datarow the output is still in one line.
Just to clarify I would like to have seperate rows inside the cell
So FRONTRUDE,7586 LIMSÆT FORRUDE,468 should be
FRONTRUDE,7586
LIMSÆT FORRUDE,468
Michaeljep:
{CurrentRow.Item(“Fakturanummer”).ToString,Regnr,CurrentRow.Item(“Værkstedrapportnummer”).ToString,VærkstedsrapportTotalBeløb,TaksatorRapportNummer,TaksatorTotalBeløb,String.Join(" “,VærkRapportCollection),String.Join(” ",TaksRapportCollection)}
HI @Michaeljep ,
Can we use like below. Not sure please give it a try. thanks.
{CurrentRow.Item(“Fakturanummer”).ToString,Regnr,CurrentRow.Item(“Værkstedrapportnummer”).ToString,VærkstedsrapportTotalBeløb,TaksatorRapportNummer,TaksatorTotalBeløb,String.Join(vbLf,VærkRapportCollection),String.Join(vbLf,TaksRapportCollection)}
Michaeljep
(Michael Jeppesen)
January 4, 2022, 8:36am
7
That didn’t work either, I also tried “Environment.Newline” and VbCrLf, but didn’t give the expected output.