DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Line Breaks in DIAdem for simple textinput by @@cht(x.yy)@@

Hi there,

 

I have a little problem with my automatic visualization in DIAdem:

I have a lot of informations saved in different channels.

Some of these informations are just numbers (double), others are strings.

 

By using @@cht(1,14)@@ the string in line 1, column 14 should be shown as a text.

And it does, but unfortunately, the string is very long and I would like to use automatic line breaks for this string in my report, so it will look just better.

 

Example:

The string in line 1, column 14 is: "Measurement Informations, velocity, wetting conditions, force developement..."

 

I would like to have a text in my report like this:

"Measurement informations, velocity,

 wetting conditions, force developement..." 

 

Thanks for your help,

Iwo

 

 

0 Kudos
Message 1 of 3
(3,968 Views)

Hello Iwo!

 

AFAIK is there no build-in command but you can build it as an user command in script like this:

Function WrapText(ByRef Text, ByRef Chars)
  Dim s
  Dim Part

  For Each Part In Split(Text, ",")
    s = s + Trim(Part) + ", "
    If len(s) > Chars Then
      WrapText = WrapText + s + vbCRLF
      s = ""
    End If
  Next

  WrapText = WrapText + s
End Function

In the report you have to change your expression to: @@WrapText(cht(1,14),30)@@

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 3
(3,960 Views)

H Iwo,

 

The only way to get texts to display spanning multiple lines automatically is to use the Text Object control instead of the Text Box control.  The Text Object control is very old and honestly a bit quirky, but it does do a great job of spanning multiple lines, and it also gives you the ability to do extra formatting you can't do in a text box.  I'm including an example that shows the first value from the 14th channel-- so you see that we can also use standard DIAdem expressions in the Text Object.

 

Regards,

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 3 of 3
(3,959 Views)