WebReport showing action start/stop time

I’ve found a way to build up the relevance here but I’m having trouble putting it into a web report. I have templates that we can put in custom relevance and spit out reports based on that relevance, but in this case, it’s always puking the final product. Relevance example:

(Name of Action of it as string, 
Name of Computer of it as string, 
start time of it as string | "na", 
end time of it as string | "na",
(end time of it - start time of it) as string | "na",
detailed status of it as string | "na",
exit code of it as string | "no exit code" , 
retry count of it) 
of results whose (ID of Action of it = 9897113) of bes actions

That relevance works on it’s own because I’m putting in the action ID, however I can’t just put that in the relevance for the report, I need to be able to filter on the action ID:

So I have to take the “whose (ID of Action of it = 9897113)” part out, all rows come back. However, the filter on the action isn’t working. It just comes back blank. any ideas how to make this report work?

I also find none of the “Action” filters work at all. But I can filter on the target computer name.

…not to mention not putting in an action id into the query take forEVER to run… and doesn’t even come back at all. We have a lot of actions.

Any ideas out there how I can run this query without obliterating my web reports server? Right now the ONLY way I have to do it is to write a seperate web service / web page and pass in the action ID to get the info. Bugs me I can’t get this natively via the typical web reports available inspectors.

You might not be able to use the built-in filtering, but you should be able to create an HTML textbox and matching Javascript to update the report with your own filters. I have done that in some of my web reports and should be able to get you an example.

1 Like

Here’s a really short example with little to no error checking but it works on mine. If you enter an Action ID in the text box and hit ‘Reload’ it builds a table of the results with that ID filtered. If you leave the textbox empty and reload it reports for all actions. You can uncomment the ‘alert’ lines to preview what it is attempting.

There are several built-in Javascript functions available; I think they’re basically the same functions as in Dashboards, but don’t know whether Web Reports has any additional or fewer functions available. All I’m using in this one is Relevance(strRelevance); , which evaluates the relevance and outputs as a string.

You can get much fancier than this with table headers, sortable tables, JQuery, etc.

<script>
function RunQuery() {
 // alert("Looking up ActionID " + document.getElementById("ActionID").value);
 var strFilter;
 if (document.getElementById("ActionID").value != "")  {
    strFilter='ID of Action of it = ' + document.getElementById("ActionID").value;
  } else {
    strFilter='true';
 }

 strRelevance='table "border=all" of concatenation of trs of (concatenation of tds of (item 0 of it;  item 1 of it ; item 2 of it; item 3 of it; item 4 of it; item 5 of it; item 6 of it; item 7 of it) of it) of ( ID of Action of it as string, '
+ ' Name of Action of it as string, '
+ ' Name of Computer of it as string, '
+ ' start time of it as string | "na", '
+ ' end time of it as string | "na", '
+ ' (end time of it - start time of it) as string | "na", '
+ ' detailed status of it as string | "na", '
+ ' exit code of it as string | "no exit code" ,  '
+ ' retry count of it) '
+ ' of results whose (' + strFilter + ') of bes actions ';

// alert("strRelevance = " + strRelevance);

document.getElementById("spanOutput").innerHTML=Relevance(strRelevance);
 
}

</script>

<table><tr>
<td>Enter Action ID:</td><td><input type="textbox" id="ActionID"></input></td><td><button id="Reload" onclick="RunQuery();"> Reload</button></td>
</tr></table>

<span id="spanOutput"></span>
2 Likes

Perfect! I’m working on a few mods but it gets me down the road. Not really an html/js guy, but its sparking inspiration!

1 Like