DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Text Object newlines

Hello 

can anybody please advise on how to insert text into the REPORT Text Object which contains newlines?

 

I'm trying GroupPropCreate/Set/Get with the text object having the corresponding @@T@@ code. But the inserted code is inserted without the newlines (\n) 

 

I'd appreciate any advice.

0 Kudos
Message 1 of 8
(4,090 Views)

I assume Report need \r\n

vbcrlf

because of the windows control world.

So you need to replace vblf by vbcrlf.

0 Kudos
Message 2 of 8
(4,045 Views)

Andreas, I did the following in the script which runs on the report but newlines are still not displayed:

 

Call GroupPropSet(1, "Notes", Replace(GroupPropGet(1, "Notes"),vblf,vbcrlf))

If i insert the same field in a regular text (Insert > Text) newlines are there. (but I need to display large paragraph of text so Text is not an option)

0 Kudos
Message 3 of 8
(4,037 Views)

If I run the following code I end up with two lines

 

Option Explicit
data.Root.Clear
data.Root.Properties("description").Value = "a" & VBCRLF & "b"
Report.NewLayout
dim textO : set textO = Report.Sheets(1).Objects.ADd(eReportObjectRTFText, "TextObject1")

TextToClipboard "@@data.root.properties(""description"").value@@"
WndShow "Report"

call MsgBoxDisp("Paste clipboard to textobject content" & VBCRLF & "End interaction mode", "MB_NOBUTTON", "MsgTypeNote",, 10, True)
InteractionOn

report.Refresh

Can you try

Call GroupPropSet(1, "Notes", Replace(GroupPropGet(1, "Notes"),vbcr,""))
Call GroupPropSet(1, "Notes", Replace(GroupPropGet(1, "Notes"),vblf,vbcrlf))

to make sure there is no currious line endings in your text.

 

Which DIAdem version are you using?

0 Kudos
Message 4 of 8
(3,998 Views)

Yes, if text is inserted into the Text Object manually then it displays newlines correctly - in that case i tried to select the Text Object - copy it (Ctrl+C) - insert (Ctrl+V) into a text editor. 

DIAdem-GRAPH.AdditionalGraphObject.PictureDefinition.Begin_AdditionalGraphObject(USI)
Page: 2;
ObjName: 'TextObject1';
GroupIDs: '';
UsiSize: 4616;
<?xml version="1.0" encoding="UTF-16" standalone="no" ?><usi:tdm xmlns:usi="http://www.ni.com/Schemas/USI/1_0" version="1.0"><usi:documentation/><usi:model modelName="National Instruments USI generated meta file" modelVersion="1.0"><usi:include nsUri="http://www.ni.com/datamodels/diadem/report/1_2"/></usi:model><usi:include/><usi:data><TEXTOBJECT id="usi1"><name>TextObject1</name><LastName>TextObject1</LastName><XPos>1.813</XPos><YPos>2.003</YPos><Height>87.246</Height><Width>73.297</Width><Text>123 92 114 116 102 49 92 97 110 115 105 92 97 110 115 105 99 112 103 49 50 53 48 92 100 101 102 102 48 123 92 102 111 110 116 116 98 108 123 92 102 48 92 102 110 105 108 92 102 99 104 97 114 115 101 116 50 51 56 32 84 97 104 111 109 97 59 125 123 92 102 49 92 102 110 105 108 92 102 99 104 97 114 115 101 116 50 51 56 123 92 42 92 102 110 97 109 101 32 65 114 105 97 108 59 125 65 114 105 97 108 32 67 69 59 125 125 13 10 92 118 105 101 119 107 105 110 100 52 92 117 99 49 92 112 97 114 100 92 116 120 49 57 53 92 116 120 51 55 53 92 116 120 53 55 48 92 116 120 55 53 48 92 116 120 57 52 53 92 116 120 49 49 50 53 92 116 120 49 51 50 48 92 116 120 49 53 48 48 92 116 120 49 54 57 53 92 116 120 49 56 55 53 92 116 120 50 48 55 48 92 116 120 50 50 53 48 92 116 120 50 52 52 53 92 116 120 50 54 50 53 92 116 120 50 56 50 48 92 116 120 51 48 48 48 92 116 120 51 49 57 53 92 116 120 51 51 55 53 92 116 120 51 53 55 48 92 116 120 51 55 53 48 92 116 120 51 57 52 53 92 116 120 52 49 50 53 92 116 120 52 51 50 48 92 116 120 52 53 48 48 92 116 120 52 54 57 53 92 116 120 52 56 55 53 92 116 120 53 48 55 48 92 116 120 53 50 53 48 92 116 120 53 52 52 53 92 116 120 53 54 50 53 92 116 120 53 56 50 48 92 116 120 54 48 48 48 92 108 97 110 103 49 48 50 57 92 102 48 92 102 115 50 50 32 97 97 97 97 97 97 97 97 97 97 97 97 97 97 92 112 97 114 13 10 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 92 102 49 92 102 115 49 54 92 112 97 114 13 10 125 13 10 123 92 42 92 84 79 80 32 92 70 82 32 48 32 92 84 82 32 48 32 92 67 82 32 50 53 53 32 92 67 71 32 50 53 53 32 92 67 66 32 50 53 53 32 92 80 87 32 49 50 51 52 49 32 92 80 72 32 49 48 50 56 51 32 92 67 87 32 48 32 92 67 72 32 48 32 92 77 87 32 56 50 51 32 92 77 72 32 54 56 54 32 92 82 84 32 48 46 55 32 32 125 0</Text></TEXTOBJECT></usi:data></usi:tdm>End_AdditionalGraphObject.PictureDefinition.AdditionalGraphObject.DIAdem-GRAPH;

 .. where the newline is represented by

92 112 97 114 13 10 

  which translates in ASCII to 

\ p a r cr nl

But trying to put this exact string in place of the newlines in the GroupProp doesn't help.

 

Your suggestion to replace the vbcr with "" first didn't help either.

 

I'm using Diadem 2015

0 Kudos
Message 5 of 8
(3,983 Views)

The clipboard contains

@@data.root.properties("description").value@@

when the code is executed.

I wrote the string containing the line feed to the root property.

 

Does the example run?

If Yes which DIAdem version do you use.

What might be different in your use case?

0 Kudos
Message 6 of 8
(3,977 Views)

Ah sorry, i didn't run your example properly at first.

The example runs only until I actually try to paste the clipboard into the text object - then it says: Error has occured - refer to logfile .. wherein:

183  Error while pasting from the clipboard.
     DIAdem cannot interpret the clipboard format.

 the logfile also contains these lines:

177  Cannot load the specified data store "Computer".
     (425): storetype must not be empty
178  14:03:31 Error:Cannot open the data store "Computer".
179  14:03:31 Error:Object required: 'navigator.display.currdataProvider'
180  14:03:31 Error:Object required: 'navigator.display.currdataProvider'
0 Kudos
Message 7 of 8
(3,969 Views)

Can you write the text

 

@@data.root.properties("description").value@@

 Which DIAdem version are you using?

0 Kudos
Message 8 of 8
(3,964 Views)