01-06-2016 10:31 AM
Hi All,
This sounds like it should be really easy to do but I cannot figure out how. I have loaded a group of channels into the data portal, the group contains 1 time channel and 5 string channels. In VIEW I can create a channel table and drop the data into it and I see all of my data values perfectly. Now what I want to do is display one of the string channel values in a Textbox but all I get by default is the channel name. I'm sure that the syntax must exist to get at the data value but I can't find it. Any help here greatly appreciated.
Thanks,
Nick
01-07-2016 12:24 AM
Hi nickstorton,
In stead of using a text box you can use a table in REPORT, like you did it in VIEW
Greetings
Walter
01-07-2016 01:50 AM
Hi Walter,
Thanks for the reply. I agree I could do it that way to be able to see the data but the ultimate aim here is that this string value will be used to populate fields in a pre-defined report structure so I cannot change how it looks so I really need to get this value into a textbox.
Thanks again,
Nick
01-07-2016 02:24 AM
Hi Nick,
here is a script to add text channel entries to a text (comment) object in REPORT:
Dim oChn, oTextCtrl, iLoop set oChn = Data.GetChannel("[3]/MyTextChn") Set oTextCtrl = Report.Sheets("Page 1").Objects("Text1") ' in case of a comment object 'Set oTextCtrl = Report.Sheets("Page 1").Objects("Comment1").Comment oTextCtrl.Text = oChn(1) for iLoop = 2 to oChn.Size oTextCtrl.Text = oTextCtrl.Text & vbCRLF & oChn(iLoop) next
Greetings
Walter
01-07-2016 02:53 AM
Hi Walter,
Thanks for the very quick reply, I will give this script a go. Actually I was browsing through the example gallery and found a similar example to what I'm trying to achieve. If you have the time take a look at the Diesel Engine test example and in the top left corner there is a text box with the engine number in it. Now in the example this is simply free text but I would imagine that if this were a real application that engine number would be pulled in from somewhere, possibly the string value of a string channel?
Thanks again for your help with this,
Nick