DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

create tables of variables in Diadem Report.

Hi eEverybody. 

 

I have been now for a good while  trying to figure out how to generate a code that does the following:

I have created a code that loads all the data channels into Diadem through a plugin. I also have creeate a OLE interface so that Diadem loads from the same excel file information regarding the channels. Now that  this information has been loadaded into a variable, I want diadem to show the data in a a table in worksheet.

 

From what i have seen Diadem only allows to create 2D-channels Table. 

Any solution would be aprreciated .

 

Regards

0 Kudos
Message 1 of 14
(8,654 Views)

Hi Paulo,

 

What version of DIAdem do you have?  Modern versions have the ability to enter an arbitrary expression into each cell that is potentially different from the other cells around it.  All DIAdem versions support displaying a 1D array variable as a table column, so long as the variable is a DIAdem global variable.  I'd actually recommend that you store all loaded or calculated information in channel values or channel/group properties-- the variable storage approach was more common a decade or two ago.

 

Why do you mention OLE?  Are you calling DIAdem from another program?  Did you use the spreadsheet reader in your VBScript DataPlugin, or did you use CreateObject() to invoke an object from Microsoft Excel?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 14
(8,636 Views)

Hi BRad!
Thanks for the quick reply.

I have been developing a code that aims to automatically generate reports.

The program has two parts!
The first that focus on the way that data is loaded into diadem and the second part that is focused on the way data is procesed.

The program developed allows user to load a specific excel file or search channel in files! ( to do so a plugin was developed). It also allows user to search for channel depending on the properties of the channel. (properties are associated with channels through the developed plugin).

The second parts allows user to view the curves in diadem report or diadem view. In diadem reports, We want to generate reports automacilally. The report will have the following standard. In thew first worksheet there will be the graph with all the channel curves (all this have been accomplished already), and then we want to creat as many worksheet as the number of the curves generated in the graph of the worksheet 1 and for each worksheet I want to creat 1 or more tables and write information regarding channel curve (information that has been stored in the global array.

I could have choosen to load then as property of channel, but has there is a big amount of information, and we just want them to be written in a worksheet, I decided to copy them to a global array in diadem, and now I want to creat a table with the information of the global array.

The part regarding the loading of the information into a variable is done, Now I woulds like to develop the part regarding the writting of the tables in worksheet.

 

attached is the part of the code that  loads the information of each channel test loaded into diadem and excel information that hi want to load into a variable

 

Any help  would be apreciated!!

0 Kudos
Message 3 of 14
(8,624 Views)

g

0 Kudos
Message 4 of 14
(8,623 Views)

Hi Paulo,

 

What version of DIAdem are you using?  Is your global array one 2D array, or is it many 1D arrays of strings?  You can reference the value of a global array with @@ characters in REPORT, like this:

 

"Test Bench : @@TestBenches(3)@@"

 

or

 

"Test Bench : @@AllData(1,3)@@"

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 14
(8,574 Views)

The array of strings is a 1D array. 

 

I have no  problems in referencing the array variable in diadem report.  The main question is how to referediferente positiond of the variabloe array in the same worksheet inside a 1D table in diadem report

 

regads

 

0 Kudos
Message 6 of 14
(8,534 Views)

The problem is that is dont know how to create a 1D table to refer diferent positions of the same variable array in diadem report. So I tried to refer the variable array as an independent coment, and the plan was to add as many coments as the number of positions that I wanted to display. 

 

Any help  would be appreciated!! 

Best Regards

 

 

0 Kudos
Message 7 of 14
(8,531 Views)

Paulo

 

Maybe the attached tdr in script will help.

 

If you use a textlist as the columns in a report, then you can refer to individual values in a array in different rows.

 

Take the script below  run it in DIAdem.  the attached tdr will refer to the values made in the script.

 

Take a good look at the report as to how the variables are  being called.

 

Paul

 

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

 

IfNotIteminfoget("GMyArray") Then

CallGlobalDim( "GMyArray()")

EndIf

 

GlobalReDim("GMyArray(100)")

GMyArray(1) = "Item1"

GMyArray(2) = "Item2"

GMyArray(3) = "Item3"

GMyArray(4) = "Item4"

0 Kudos
Message 8 of 14
(8,519 Views)

Thanks for the reply.

But I  want to create table with two columns.

all the values have already been loeaded from a excel file into a global array. 

The questions is how can I create a table with two columns and within a cycle for or while start filing the table up!

 

Thank you

0 Kudos
Message 9 of 14
(8,514 Views)

Hi Paulo,

 

Paul showed you how to associate all the values of one global array to one table column in REPORT.  If you want to do this for N different global arrays and table columns, you just need to repeat the process N times.

 

If you want to reference only a selected, contiguous row range from those arrays, you can assign an @@ expression to each table column and reference the array variable with D2TabRow and a hard-coded offset for the array index.

 

If you want subsequent table rows to pull data from different global variables, you will have to use a column of type "Text List", available in DIAdem 2012 and later.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 10 of 14
(8,402 Views)