DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to dynamically set table number and table row numbers

Hi,

 

I'd like to use table in the report to display some calculation results.

These results are saved as this way:

group1

channel1.1

channel1.2

 

group2

channel2.1

channel2.2

......

 

group count might be different for different datasets and channels in different groups have different  length.

 

I want to put one group all channels into one table.

How could I dynamically create different number of tables based on group counts and dynamically set table row numbers based on channel length?

 

Thank you for everyone's help.

 

LX

0 Kudos
Message 1 of 3
(4,362 Views)

If you dynamically build your report you can adjust the objects on the report.

 

Here's just a short snippet from one of my reports that shows the report being build dynamically

 

for i = 0 to 11
Set cmtBox = Report.ActiveSheet.Objects.Add(eReportObjectComment,"cmtBox" & j & str(i,"dd"))
cmtBox.Position.ByBorder.bottom=92 - (DistanceBetweenBlockRows*(i\3) + (j*DistanceBetweenBlocks)) ' go to next row every 3
cmtBox.Position.ByBorder.Height = StandardHeight
cmtBox.Position.ByBorder.Left=2 + (9*((i)mod(3))) ' go to next column every time and reset to left every 3
cmtBox.Position.ByBorder.Right=100-(cmtBox.Position.ByBorder.Left + 😎
Set MyArrow = cmtBox.Arrow
MyArrow.ArrowHeadAtBegin = eArrowHeadNone
MyArrow.ArrowHeadAtEnd = eArrowHeadNone
MyArrow.Line.LineType = eLineTypeNone
cmtBox.Comment.Text=arrStats(i)
cmtBox.comment.Alignment=eCommentTextAlignmentCentricif i = 3 then ' CPK

if MyVar(cg,j + (gGraphPageNum * GraphsPerPage)).Properties("ResultSPCCpk").Value < 1.00 then
cmtBox.Comment.BackgroundColor.RGB = RGB(255,150,150)
else
cmtBox.Comment.BackgroundColor.RGB = RGB(150,255,150)
if not gbPrintAllTests then
CreateReportGraphPage=gPartialPageCreated ' inform calling routine to stop requesting more pages - i'm in the green
end if

end if
end if
next

0 Kudos
Message 2 of 3
(4,340 Views)

Hi LX,

 

I recommend you build a REPORT layout file that has the table positioned and its display defined as you wish to see it.  Then you can load the *.tdr file for the first Group and append it for each subsequent Group, and for each Group define programmatically one Table column for each Channel in that Group.  This is similar to the last post, but I think it's easier to tweak a loaded/appended layout than to create the table from scratch.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 3 of 3
(4,259 Views)