Adding link to custom report

(imported topic written by lmpymilk91)

Can I get some help adding a clickable link to the computer count? I would like to be a able to click and view the list of computers per returned value.

edit: well the images aren’t loading for me so here is an attachment

Thank you

Here is what I have now

Here is what I would like to have

Here is the current code

<table> <thead> <tr> <th>Application Name</th> <th>Region</th><th>Number of computers</th> </tr> </thead>   <tbody> <?Relevance     ( concatenations of trs of ( td of ( tuple string item 0 of item 0 of it ) & td of ( tuple string item 1 of item 0 of it ) & td of ( item 1 of it ) ) of ( ( it, ( multiplicity of it as string ) ) ) of unique values of ( ( ( concatenation 
"," of ( unique values of values of result ( it, bes property 
"App Update Status" ) ) ) , ( concatenation 
"," of ( unique values of preceding texts of firsts 
",DC" of following texts of lasts 
",OU=" of values of results ( it, bes property 
"Active Directory path" ) ) whose ( it as lowercase contains 
"region" ) ) ) as string ) of bes computers whose ( exists ( unique values of preceding texts of firsts 
",DC" of following texts of lasts 
",OU=" of values of results ( it, bes property 
"Active Directory path" ) ) whose ( it as lowercase contains 
"region" ) AND exists ( value of result ( it, bes property 
"App Update Status" ) ) ) ) ?>   </tbody>

(imported comment written by lmpymilk91)

I guess only one attachment

(imported comment written by jessewk)

Hi lmpymilk,

You will need to be running 7.1 to get the behavior you are looking for.

If you have 7.1, you can do it with just a few steps. Here is an outline:

  1. Add a new style to create clickable text that looks like a link. I use this css class:

.pseudo_link

{

text-decoration: underline;

color: #5386b3;

cursor: hand;

}

  1. Change your relevance to output the number such that when the number is clicked, it runs a javascript function. Also add the psuedo_link class so it looks clickable:
<?relevance html tag ("span", attr lists of ("onclick", "showComputers()" ; "class" , "pseudo_link"), 2 as string) ?>

Replace “2” with the number of computers from your expression.

  1. Write the showComputers() function. You’ll need to change the relevance in step 2 so that it passes enough information to showComputers() to run a relevance clause returning the set of computers with that particular criteria. Your relevance clause should return a list of computer ids and you can pass that to the OpenComputerGroup() function. OpenComputerGroup() is new to Web Reports in version 7.1.

Pseudo Code:

showComputers(status)

{

computers = EvaluateRelevance(ids of computers with app update status = status);

OpenComputerGroup(computers);

}

Hope that helps,

Jesse

(imported comment written by lmpymilk91)

Thanks Jesse, we are at version 7.0.9.164 right now. I just heard today we won’t be able to install 7.1 until after the first of the year.

(imported comment written by jnmoore91)

jessewk

  1. Change your relevance to output the number such that when the number is clicked, it runs a javascript function. Also add the psuedo_link class so it looks clickable:
<?relevance html tag ("span", attr lists of ("onclick", "showComputers()" ; "class" , "pseudo_link"), 2 as string) ?>

Replace “2” with the number of computers from your expression.

Hi jessewk,

I’m trying to create a dropdown list of bes property names and setting each option to the id of the bes property–and sort the names. As it stands, The relevance I’m using is

<?Relevance (html tag ("option", it)) of (unique values of names of bes properties whose (analysis flag of it is true AND exists results of it) as string) And it sorts it just fine, however I wish to value of each option, and I thought the attr list of would help me accomplish this: <?Relevance (html tag ("option", attr lists of ("value", item 1 of it), item 0 of it)) of (unique values of names of it, id of it) of bes properties whose (analysis flag of it is true AND exists results of it) as string) ?>

, however, it doesn’t recognize the

attr lists

.

Here is the error:

The operator “attr lists” is not defined.

Do you know of another way to set the value?

(imported comment written by jessewk)

yeah, that’s a pretty bad error message. ‘attr lists’ is expecting a tuple with two string arguments. Your passing it a string and an integer.

You have the same problem with ‘html tag’ too. It’s expecting a string for the third argument and you’re passing a ‘unique value’ object.

This will work:

(html tag (“option”, attr lists of (“value”, item 1 of it as string), item 0 of it as string)) of (unique values of names of it, id of it) of bes properties whose (analysis flag of it is true AND exists results of it) as string