DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Background color in test report .TDR file

Hello all,

 

I'm working on diadem script, and I need some help with coloring some tabs. My table is 5x8, and in last column, I use a criteria who show "OK" or "NOK". Can you please help me do something like: when result is OK color background in green, when is NOK, color in red.


Thank you in advance.

0 Kudos
Message 1 of 5
(1,151 Views)

Hi SkePsis,

 

For this you need a user command VBS for the event “OnDrawingCell”

The example “Using User Commands for Trend Displays in Tab” explains how this works.

 

Greetings

Walter

0 Kudos
Message 2 of 5
(1,120 Views)

Thank you fir hint. I take a look, but I'm still learning about Diadem, for moment I didn't get the final result. I don't know how exactly example script run

0 Kudos
Message 3 of 5
(1,109 Views)

Hi SkePsis,

 

I try to briefly explain the example.

In DIAdem supports several events for different situations. An event is a callback function which is called at certain situations. This function is a piece of VBS script code which is customizable. One of these events is “OnDrawingCell” which is called each time if a cell of a certain column in a REPORT table should be drawn.

 

In the main script “2D_Tab_UserFormat_1.vbs “ you find the “OnDrawingCell” commands to register the event function in the end of the script.

 

Report.Sheets("Sheet 1").Objects("2DTableTrend_Case1").Columns(4).Settings.OnDrawingCell = "TabTrendOnDrawingCell_Case1"

Report.Sheets("Sheet 1").Objects("2DTableTrend_Case2").Columns(4).Settings.OnDrawingCell = "TabTrendOnDrawingCell_Case2"

 

The VBS functions "TabTrendOnDrawingCell_Case1" and "TabTrendOnDrawingCell_Case2" are defined the user commands and defined in the file “UserCmdReport.vbs”. (More info about user command you find in the DIAdem help with key work “ScriptCMDAdd”). In these user commands is defined in which situations the background color is changed.

 

You can register a user command interactively or the VBS command “ScriptCmdAdd” – like the example does.

 

Greetings

Walter

0 Kudos
Message 4 of 5
(1,097 Views)

Thank you for your time and support. I will try to adapt code for my application. 

Have a great day!

0 Kudos
Message 5 of 5
(1,092 Views)