Reporting on a New Data Class Such as Computer's Business Function
Creating a new asset is nicely explained in an article titled Creating a New Asset Type on Juice and adding attributes to an existing asset type is explained in another one called Network Device Asset Management. However those articles are a bit technical and I wanted to present a basic example of adding attributes to an existing asset type such as computer and then turning around and simply reporting out that data.
Once you read this, another good article related to report writing is How-to Guide on the Report Builder.
Here is the scenario: A customer needs to add the attribute of Business Function to computers. For example is the computer used as a Kiosk or Test machine or for Training or is it a Production machine.
In order to track this data we are going to add a new dataclass called Business Function. We need to allow multiple entries per computer in case the machine has multiple functions. Since it could be split against different functions, we are also going to add a field for what percent it is being used in each of those functions. We are going to leave it to the user to ensure that the percents add up to 100 percent.
- Open the console and go to Configuration.
- Drill-down to the Resource Settings > Data Classes > User Defined folder.
- Right click on the folder and select New > Editable Data Class.
- Name the new data class. For example, I used "Business Function".
- If you want the data class to be displayed on a different tab than the General tab when you edit computers, type in the name of an existing tab or create your own new one in the field labeled "Data Entry Tab Name". If you give it a name that is not currently a tab in the edit screen, a new tab of that name will be created. In my example I had it display on a tab called simply "BF".
- Next, we add the attributes, or fields to the new data class. Click the "Add New Attribute" button and give the field a name. Here I choose "Function".
- Select the check box for "Multiple Rows".
- Select "Static List" for the Type of data from the pull-down menu.
- Use the pencil icon next to the field type to enter values into the list (see the diagram above).
- Add another attribute for the percent.
- Once you have the new data class created and saved, we need to add it to the Computer Resource Type. Drill-down on Resource Settings > Resource Types > Asset Types > IT > Computer.
- Click "Add Data Class" and when the Item Selector comes up, drill-down to the new data class you just created (Resource Settings > Data Classes> User Defined > Business Function).
Save your change and now you are ready to add some data and then report on it. Go to an existing computer and right-click on it and select Edit. You should find a new tab called "BF" or whatever you may have named it.
Go ahead and enter some data to this and a couple of other computers. Now we are ready to create a report.
- Go to what ever folder you want to create your new report in.
- Right-click and select New > Report.
- Give your report a name and selected Simple Report.
- Choose Computer as the Resource Type to report.
- When you select the columns you want to report, Business Function will automatically be listed with the other attributes of computers.
- Select what columns you want like Resource > Name and Function and Percent from Business Function.
- Finish creating your report and run it.
As you have seen, adding an attribute or two to an existing resource type is straight forward. The fields are automatically added to the edit screen to allow you to start putting in information. And the new fields are also automatically added to the report builder making reporting the new data extremely easy. The whole process took around 20 minutes.
Just a couple of other notes. If you want to create more sophisticated reports and need to reference the data class directly for example writing SQL, the table name is simply INV_ plus the name of the data class. In this example it would be Inv_Business_Function.
There is also another interesting Juice article that goes from creating a custom data class to populating it with a script (to determine if a machine is powered on or not) through reporting it (there are two parts to the article).




