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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to format the excel cell for displaying pass or fail in green and red color with the conditionl formating

hai NI,

I am doing project in calibration and verification of analog io cards using LABVIEW.For report generating in excel i want to display pass or fail cells in green and red color.so how to give that condition for formating the cells using report generation tool kit.Pls reply soon.... 

0 Kudos
Message 1 of 10
(5,406 Views)

Did you try to use the "Excel Set Cell Color and Border.vi" from the Report Generation toolkit. I am sure this does what you expect.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 10
(5,396 Views)
hai Anand,
i tried it.But how to give condition for pass cell in green color and fail cell in red color.It asks for ly range of the cells.
0 Kudos
Message 3 of 10
(5,370 Views)

So you know how to do it but stuck how to implement. How are you deciding the Pass/Fail conditions and how are you passing it to the Excel report? The logic is very simple, when you write Pass set the color as Green and if it is fail set the color to Red. Please attach the code you developed so that we can give you a more appropriate solution.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 10
(5,361 Views)

We have no Idea what you are comparing, but I wrote a quick diagram using The report tool to show you how it could be done. Like the above poster mentioned you really need to give more information for some ideas on a solution.

 

I wrote this to put the numbers in the array to red or green in Excel based on whether they are greater or less than zero.

 

 

diagram2.png

Message 5 of 10
(5,344 Views)

I have attached my report generation tool in labview.In that output data is in string.It create the excel document with RESULT column as pass or fail.in your attached picture numeric string is compared and gives true or false to the case structure.But i want compare the pass or fail in result column in excel.That case structure is implemted correctly using excel color and border tool but for selector in case loop should compare pass or fail string.

 

please give some solution as soon as possible.

0 Kudos
Message 6 of 10
(5,302 Views)

I don't understand.  The code you present shows that it wasn't written by a beginner, but by someone (you, perhaps?) with some knowledge and familiarity with the Report Generation Toolkit.  In addition, you seem to understand the previous "solution" to your question about how to color individual cells Red or Green based on some condition.  Now you wnat someone to "finish your project" for you by doing the one part of this project with which you are the most familiar, namely deciding which is the specific criterion for coloring the cells?  Will you be willing to tell your manager that the solution was completely provided by the NI Forums, and give whoever posts the solution full credit to your superiors?

 

 

0 Kudos
Message 7 of 10
(5,291 Views)

Your output data in your VI is a numeric, and then converted to a string before writing to excel. I am not seeing the results column.

 

I think you may be trying to bite off too big of a chunk. Look at the example I gave you. Instead of trying to compare the whole table of data at once, the example I gave you does each individual piece of data in the array and then writes that data, and then formats the cell. You have a 2D array of data, that can be compared and then written as a string in the same fashion. 

0 Kudos
Message 8 of 10
(5,248 Views)

I make some changes in report generation tool.In that result coloumn is inserted and analog op% error coloumn produces automatic value in output data.It should be lessthan plus or minus 1%.This condition is checked and the result colomn is display pass or fail.That depending on pass or fail shoud bo color on green and red.

0 Kudos
Message 9 of 10
(5,227 Views)

Okay, This is what I am understanding. You have a 2D string array being written to an Excel file, where column 8 is the "Pass/Fail" column. I have modified the program I wrote above to reflect what I think you are trying to do. You should easily be able to modify it and use it in your program.

diagram2.png

0 Kudos
Message 10 of 10
(5,205 Views)