DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

2D Tabelle Zellen verbinden

Hallo Forum,

Gibt es eine möglichkeit in einer 2DTabelle im Report z.B. 2 Zellen zu verbinden, also per Script?

(Wie in excel 2 nebeneiandner liegende Zeilen verbinden zu einer)

mfg

0 Kudos
Message 1 of 6
(2,764 Views)


Sie können viele gleichmäßig beabstandete Werte zwischen den beiden Punkten einfügen, indem Sie eine for-Schleife verwenden. Vielleicht ein konkretes Beispiel geben? (Ich habe Google Translate verwendet, damit die Kommunikation nicht 100% ist)

 

you can insert many evenly spaced values in between the two points using a for loop. Maybe provide a specific example? (I used google translate so communication is not 100% here)

0 Kudos
Message 2 of 6
(2,736 Views)

Thank you for the response.

 

Okay for example i want a 2DTable with 2 columns and 20 rows. Is it possible that i can concet (at any row 1-20) 2 cells to one single cell?

In the report i cant conect the cells thats why i looking for a script command.

i have uploaded one screenshot for your better understanding.

 

 

 

0 Kudos
Message 3 of 6
(2,730 Views)

Really hastily put but a good start point

 

Option Explicit  'Forces the explicit declaration of all the variables in a script.

DIM DELIMITER: DELIMITER = " - " 

Dim chn1, chn2, resChn, i
Set chn1 = Data.Root.ChannelGroups(1).Channels(1)
Set chn2 = Data.Root.ChannelGroups(1).Channels(2)
Set resChn = Data.Root.ChannelGroups(1).Channels.Add("result", DataTypeChnString)

For i = 1 To chn1.Size Step 1
  resChn.Values(i) = chn1.Values(i) & DELIMITER & chn2.Values(i)
Next

Assume your column 1 and 2 are in group 1 and are the first and second channels in that group.  Can definitely be developed into a more modular function

0 Kudos
Message 4 of 6
(2,726 Views)

I dont think you got me right. I dont want to add up(calculate) columns together or something like that. My Problem is more trivial i want just put 2 cells together. So i can write in one cell out of 2 cells summarized. excusme me for my bad explain and english.

 

Thank you for your help so far.

0 Kudos
Message 5 of 6
(2,706 Views)

When running the code above on a file that is exactly like your example picture (file attached), I get a result group as shown in picture (attached).  Change the value of DELIMITER to change the way the columns a joined.  Try running the code on Example File.tdms to see

Download All
0 Kudos
Message 6 of 6
(2,685 Views)