From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

OnDrawingCell appears to be deleting all cell values

Solved!
Go to solution

Hi Gizmogal,

 

DIAdem 2012 and previous versions had an ANALYSIS routine to sort the values of multiple channels based on the values of only 1 channel.  DIAdem 2014 has an ANALYSIS function that can sort the values of multiple channels based on the values of 1 or more channels.  In both cases the function is called "Sort Channel Values" and it's located in the "Channel Functions" ANALYSIS palette.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 11 of 17
(2,893 Views)

Hello,

 

I am currently facing the same problem where the log file says the same as in your case. My limitation is that I have to use expressions and cannot switch to Channel. It would be a great help if you can shed some light on the topic.

 

Regards

Sarry 

0 Kudos
Message 12 of 17
(1,677 Views)

Hi Sarry,

 

I quickly reviewed all the various posts on this thread, but I didn't find any reference to log file content.  What does your log file say, exactly?  What problem are you facing?  What DIAdem version are you using?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 13 of 17
(1,656 Views)

Hi,

 

I am talking about this

 

 

del.PNG

 

Regards

0 Kudos
Message 14 of 17
(1,620 Views)

Hi Sarry,

 

Please post the code you're using which throws this error.  I've seen this sort of error most often when customers try to combine the old GraphObj...() commands with the new REPORT object in the same VBScript, but I can't know for sure until I look at your code.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 15 of 17
(1,591 Views)

Hi,

 

Here is what my table looks like (PS: It is in German, but I guess Its clear what is wriiten, I am using expressions).Table.PNG

And here is the code I am using:

Option Explicit 

Dim o2DTable, oCol, i
Set o2DTable = Report.Sheets(1).Objects("2DTable1")
call GraphObjClose("2DTable1")
for each oCol in o2DTable.Columns

  oCol.Settings.OnDrawingCell = "TableDrawingCell"
next
call Report.Refresh()
call WndShow("report","maximize")
Sub TableDrawingCell(Context, Cell)
  
  If (Context.Table.Name = "2DTable1") Then
    if Cell.Value <= "2.0" then
      Cell.Font.Color.SetRGBColor(RGB(0, 255, 0))
    else
      Cell.Font.Color.SetRGBColor(RGB(255,0,0))
    
    end if
  End If
End Sub

Regards

Sarry

0 Kudos
Message 16 of 17
(1,567 Views)

Hi Sarry,

 

Why do you have the GraphObjClose() command in your code?  I suggested that you only use the Report object and not mix in the old GraphObj...() commands.

 

You should compare Cell.Value to 2.0, not "2.0", in order to make sure it's a numeric comparison and not an alphabetic comparison.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

 

0 Kudos
Message 17 of 17
(1,513 Views)