You run the ping in your load script? Do you use the result to set values in a tables field?
If so, you might have a table like
For example, In a straight table you could use the visual cues to set the background colors depending on Alive Flag ( a table box misses that feature, I think).
Create a straight chart, set ComputerName as dimension and Alive as expression.
In Visual cues tab, set the upper and lower limits to 1 resp 0 and set the colors for text and background as you like.
Hope this helps,
Once you have the data in a straight table, you can also set the background of the cells conditionally. On the expressions tab, click the small + sign next to the expression, select Background, and enter the expression in the Definition box, something like =If(Active, Green(), Red())
Hope that helps
Seems I´m totally stuck here.
I figured out how to make a straight table and I can add a field for the result of the ping.
When I use SetInputFieldCell to set the content, when running the script, the script stops and shows the straight table with a grey cross in it and the script pops up. No errors, no results.
Searching the Internet it looks like I must use an input field.
I can´t figure out how to make an input field. I can declare it in the script, but it shows as a variable, not as a field.
I´m using the free professional version, so examples won´t work.
You may not be able to open our files but users of the full version can open yours so post your qvw and someone may be better placed to help. I'm not quite sure I follow what you're doing can you confirm I have understood the following correctly?
1. You load the computer names from a DB table but not the latest ping results.
2. You are running a macro from within QV to ping the computers?
If I have understood you, you could do something like create a variable vResults and use the macro to write a delimited string of results to the variable. E.g. vResults = "computer1:1,computer2:0,computer3:1,computer4:1," (ensure final comma) etc. Then, in a straight table chart add ComputerName as the dimension and in the expression use the following:
=TextBetween(vResults,ComputerName & ':',',') to show the results in a nice table.
Then, in the background colour expression use:
IF(TextBetween(vResults,ComputerName & ':',',')=1,LightGreen(),Red())
Hope this helps,
I don't think you necessarily need an input field here, but maybe I misunderstood your problem.
Besides that, SetInputFieldCell is an automation interface member so how do you use it?
Anyway, I think you could execute an (external) command script in the Qv script part to ping your machines. This script could (in a simple approach) just writes the results back to a file and this file could be read in by QV. I believe more fancy solutions without the need for the external file will also be possible.
But since your original question was about highlighting the results in a specific table cell, I concentrated on this part ;-)
So please have a look at my attached file.
- pscript.cmd is a simple batch file that pings machines and writes results back to a file (list of machines is read in from file iplist.txt).
- pingtest.qvw executes this batch file during load, then reads in the created file and voila - here you go with your results table
- in the QV document, I used an expression for the expression attribute background colour, to highlight the failed pings then (you could also use visual cues or some other formatting (text style, dimension name formatting,...)). I added some examples how to highlight.
Hope this helps,
P.S:you might need to adjust the parse phrase "Lost" in the batch command file to your localized phrase for lost pings returned by your OS
pingtest.zip 131.0 K
THX for replying.
What I'm trying to accomplish is this. I want to use the report together with an asset management application. In the database I have a list of equipment details from computers, network equipment, printers etc (assets), including the name of the asset. I want to make a kind of dashboard with an overview of the equipment and I want to show if it is "alive" in the network.
The list might be long, so pinging every asset on load time is (when I think about it) not desired because the load time can be long. I implemented a button with a macro (VBS) to perform the ping on demand. As desired a warning can be given that execution might take a while.
So in the database tables is nothing like a ping result.
I attached my current QV doc. It uses a plain table with the computer name, the OS version and the assigned user. Nothing fancy.
And the macro returns an error on inserting the text in the table.
Thanks in advance,
test2.qvw 136.2 K
I think the main problem is to use string input fields in a table chart. This is not possible as far as I know, because you have to use inputsum / inputavg in a table chart. But you can use string input fields in a table box / list box, and that's what I did (and the table chart will be updated accordingly).
Then I added a Inputfield declaration in the script, I think that was missing, too.
The rest is mostly using your code (I changed a little bit the index calculations, but just playing around).
Have a look and see if this will fit your needs.
I think the input fields solution will be per user, i.e. each user has to call the macro to see the results. So if you have a lot of users, it might still be better to think about a periodically called Alive-Check, writing the results back somewhere and use a server reload to just update the alive values.
pingtest2.qvw 153.5 K