02-24-2009 09:49 AM
I need to present text data (RX/TX log) in a report. The text data as stored in a custom property (Logs) in a TDM file.
If I programatiaclly insert the data in a comment box it doesn't recognize the tabs and carriage returns.
If place the data in a text object (via manual copy and paste) it doesnt recognize the tabs and carriage returns. I can't figure out how to insert it programatically (CTRL+A while in record mode doesn't work.
After the formatting is working properly i need to have the text that doesn't fit on the first page transfer to the next page.
Does anyone have any ideas or pointers.... I have attached a .TDM and .TDR to give a better understanding of my issues..
Thanks
02-25-2009 05:57 AM
Hello BBANACKI,
I think I have solution for your issues. I have attached the modified tdr-file.
Hopefully it's what you expected.
regards
romi_wo
02-25-2009 08:24 AM
This is the exact format I needed.... @@ replace(replace(GroupPropValGet(19, "Logs"),vblf,vbcrlf),vbTab," ")@@
Now
that the formatting is correct are there any thoughts on how to wrap
the text to another comment box on another page? Right now the text
just goes off the page and cannot be seen on the report......
Thanks
02-26-2009 03:18 AM
Hi,
for this issue i would suggest that you use the "Mid" Function to extract a defined length of characters from your log-string:
Mid (string, startPosition, [Length])
e.g.:
for the first page:
Mid (logstring, 1, 1000) ' extracts the first 1000 characters from a string, starting with the first one
for the next page you simply change the startPostion and the Length:
Mid (logstring, 1000, 500) ' extracts 500 characters from a string, starting @ charachter 1000
Therefore you need to know how long your string is.
If you have different string-length for each logstring please let me know,
because then I would suggest to write a small script which dynamically creates an appropriate amount of pages depending on the logstring length.
Regards
romi_wo
02-26-2009 07:57 AM
Unfortunately I do have a different string-length for each logstring.
Don't I need to know how many lines the text takes up (including the auto wrapping text and line feeds)?
Thanks
02-26-2009 09:57 AM
Hi Bbanacki,
The only word wrap functionality in REPORT is in the (somewhat antiquated) Text Object, which is to be distinguished from the usual Textbox. You can insert references to properties in the Data Portal into the Text Object such that they automatically appear and also word wrap.
But there is no built-in way in DIAdem to span any content from page to page. The typical request is to have a single table which shows up on multiple pages, and for this I have an example, but it uses VBScript to chop up the table into N sections, using a fixed number of rows for the table portion in each REPORT sheet.
Why would you want portions of the same Data Portal property to show up on different REPORT sheets?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
02-26-2009 03:25 PM
I tried the Text Object but I couldn't figure out how to programmatically fill it in a using the macro record function (for some reason the CTRL+A method in record mode didnt work). I have found the word wrap feature automatically works in the comment box.
I completely understand how the to chop up a table into N number of sections, I actually do that for another section of data in the current report I am working on (this is easier because it is data in a channel). Unfortunately the current issue I have consists of text data in a log property field. I need to split this text up if it is to long and insert the remainder into another comment box on another page.
I need to display this text property on different report sheets so the information is ledgible to the reader.
Thanks,
02-27-2009 08:30 AM
Hi Bbanacki,
It is true that both Ctrl-A and drag&drop do not work in the Text Object. You can right-click in theText Object, though, and choose to insert a DIAdem expression of the type @@ChnPropValGet(ChanPath, PropName)@@ or @@T1@@. From there on out, these values will automatically update with content in the channel property or the T1 variable, respectively. So you could either hardcode the number of characters you want to see in each sheet inside that sheet's Text Object's DIAdem expression, or you could have each DIAdem expression on a different page point to a different variable or Channel or Group property and programmatically set these properties using the Mid() function approach Twigeater suggested.
You might consider using the old DataSetHdr(1) .. DataSetHdr(100) variables-- there are 100 of them and they are declared automatically every time DIAdem starts and available to read and write from in a VBScript and will embed just fine in the Text Object.
But you're going to have to programmatically provide the page spanning logic for the Text box the same way you've done for the tables.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
02-27-2009 08:32 AM
Hi Bbancki,
My bad, I posted the wrong variable name from memory-- there are 2 sets:
DataSetComment(1) .. DataSetComment(100)
DataSetCommentN(1) .. DataSetCommentN(100)
Brad Turpin
DIAdem Product Support Engineer
National Instruments