Use relevance code to create reports on WebReports

Hi everyone! This is my first post on the forum.
I would like to ask if it’s possible to use relevance code to create a sort of custom reports on webreports.

I’ve noticed some limits in the functionality of the webreports’s, for example, the limits while using boolean logical operators where you can choose two main ways of setting up the query:

  1. a set of conditions with ORs divided by ANDs conditions
    ex.

(COND1 OR COND2) AND (COND3) AND (COND4 OR COND5 OR COND6)

  1. a set of conditions with ANDs divided by ORs conditions
    ex.

(COND1 AND COND2) OR (COND3) OR (COND4 AND COND5 AND COND6)

Please note that the CONDX means an example condition that you could choose on the report.

I’ve also noticed a page in the webreports where you can insert custom relevance code, which is the QNA of the web reports.
The site portion is located at https://<webserver_address>:<webserver_port>/webreports?page=QNA

Here is a page of Docs if found about the webreports QNA - link

Can anyone help me find out if that’s possible?
I think this would really improve the way webreports can be used and leveraged.

I’m open to any kind of feedback, everyone is welcome!:wink::hugs:

First, welcome to to the Forum, it’s great to have you here!

Yes, you can, and you were very close to finding it - from the same site, check the ‘Other APIs - Web Reports API’ link at https://developer.bigfix.com/other/web-reports-api/

First you must configure the Web Reports server to allow custom reports, if it’s not configured already - see https://help.hcltechsw.com/bigfix/11.0/platform/Platform/Web_Reports/c_creating_a_custom_report.html

I’m afraid it does require some HTML/JavaScript skills to build these kinds of fully-custom reports. When building Custom Reports, you as the developer must perform all the HTML formatting, if you want; if you want the layout to be a table, you have to build the rows & columns.

You can still use the Filters from the top section of the custom report; those take effect at the SQL level before data is even visible to your report.

You can insert Relevance into your report using the reserved tags <?relevance [some relevance query] ?>. For example <? relevance number of bes computers ?> might insert ‘10,000’ into the generated HTML page.

Since you have to do all the formatting, once you get the hang of it and want to add fancier content, you might find some of my examples at https://github.com/Jwalker107/BigFix/tree/master/Test%20Content/Web%20Reports useful. These examples use jquery and dataTables.js to apply formatting to tables, make the columns sortable & searchable, and provide exports to CSV, XLS, or PDF.

Once you’ve had a chance to look through those, do feel free to post back here with more questions.

3 Likes

With regard to the web report filtering limitation, you can overcome that to some extent, by using saved filters.

Save the OR conditions to a filter with the “Any” condition selected. When you have saved the filters, you can load these to create a report of “all” conditions, e.g.

image

image

Now load these filters where you can also use other properties as AND filters

image

I used a filter name to match your example but you can of course save these with whatever name fits you needs. Its not ideal as you now have the overhead to to create and maintain filters but its one way to overcome the current limitation.

6 Likes

I…never even considered that. Thanks, that’s super useful!

2 Likes

Same here, you learn something new every day around here regardless of how well you think you know things!

2 Likes

Indeed Great stuff ! thanks for knowledge sharing @SLB I learned something new today :slight_smile:

2 Likes

I agree, thanks for everyone for their feedback.
@JasonWalker I reviewed your purposed information, thanks for everything you provided.
Sorry for my late response, I forgot I had this message as a draft

1 Like