Graphic reports from result list

(imported topic written by Harald.Zarakowitis)

Hi,

is there a way to automatically create a graphic report from a returned list from web reports?

Analysis return something like this:

3.6.4 (Rel) 16 2.94%

4.0.1 (Rel) 22 4.04%

4.6.00.0045 38 6.97%

4.6.02.0011 174 31.93%

4.8.00.0440 67 12.29%

4.8.01.0300 221 40.55%

Just a link to a pie chart for instance since it isn´t to hard to program I guess.

In the meantime I will stick to excel :wink:

Best regards,

Harald

(imported comment written by jessewk)

Harald,

I don’t have an easy way for you to add a chart to a stock report, but it’s easy to do for a custom report so I would just create a custom report instead. It shouldn’t take too long to set up and I’ve done the hard work for you already. All you need to do is create a new custom report with the code below. Of course you will want to modify it to change values, colors, chart size, etc., and you might want to wrap it in some additional HTML or even include it in a report like the one discussed here: http://forum.bigfix.com/viewtopic.php?id=212

A couple of notes:

  1. This script uses an Office Web Controls object to draw the chart. In this particular case I used OWC11 (we also support OWC10 in the console). You will need to install Office Web Components before this will work: http://www.microsoft.com/downloads/details.aspx?familyid=7287252c-402e-4f72-97a5-e0fd290d4b76&displaylang=en

  2. There is no error checking in above script. You may need to add some to deal with certain cases.

  3. The values are hard coded. I would actually generate these using relevance. Something like this:

// Set the values.

<?relevance javascript array "the_values" of multiplicities of unique values of values of (results ( it, bes property "OS" )) of bes computers whose ( exists result ( it, bes property "OS" ) whose ( exists value of it AND error flag of it = false AND exists tuple string item 0 of value of it ) ) ?>

// Set the categories

<?relevance javascript array "the_categories" of unique values of values of (results ( it, bes property "OS" )) of bes computers whose ( exists result ( it, bes property "OS" ) whose ( exists value of it AND error flag of it = false AND exists tuple string item 0 of value of it ) ) ?>

The attachment shows an example of the graph this report produces

(imported comment written by BenKus)

Actually, the standard web reports reports should be easier than custom reports for this case.

Simply try the following:

  1. Login to Web Reports.

  2. Choose “Create”.

  3. Pick “Single Retrieved Property Status” and pick the property you want.

See attached report.

Ben

(imported comment written by cstoneba)

very nice jessewk, but mine isn’t showing all results in the legend. Any way it can either be sorted by number of resut (not alphabetical), or just show all?

(imported comment written by jessewk)

Wow, that’s some old code up there. In 8.0 you will be able to create your chart in web reports very easily. Can you wait a few weeks(ish)?

(imported comment written by cstoneba)

I was actually trying to embed the js into an asp page…

(imported comment written by jessewk)

The relevance language doesn’t currently support sorting (although a really nice feature that makes javascript sorting of relevance results super fast is coming in 8.0).

If you want to sort it first you’d have to loop through the results and sort them in javascript before passing the array to the chart control.

(imported comment written by cstoneba)

sarahjohn63, where in BigFix webreports do you see the option to pick “embedded asp page”?

(imported comment written by MattBoyd)

Uh… I think that’s a spam bot…

(imported comment written by cstoneba)

well that’s depressing, here I thought someone had a solution. If they could only spam helpful responses, then we’d be in business…

(imported comment written by MattBoyd)

Agreed.

I’m not sure how far you’ve gone into the rabbit hole, but you could probably produce some charts with the Google Charts API… http://code.google.com/apis/chart/docs/making_charts.html

I don’t think you even need to worry about javascript with that… you could probably do all of it (including sorting results) with ASP code…