How to create a report with Report Builder using the Simple type, and have it display both computers and virtual machines

book

Article ID: 180916

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server)

Issue/Introduction

 

Resolution

Problem

A common problem people notice when building reports with the simple report builder using the asset type of "Computer" is that virtual machines do not show up in the results of the report.

Environment

Cause
Some Background Info

Inventory Solution 6.1 SP1 introduced the Virtual Machine classification of machines. This means that any virtual machine that was previously displayed as a "Computer" will instead show as the new "Virtual Machine" classification of device.

When a user creates a new report using the simple report builder and clicks the finish button, the following piece of SQL code is appended to the query generated:

where/and [ResourceTypeGuid]  = '493435f7-3b17-4c4c-b07f-c23e7ab7781f'

The "where" exists if no other criteria have been defined otherwise "and" will be in its place.

The problem with this code is that the resource type GUID "493435f7-3b17-4c4c-b07f-c23e7ab7781f" is the GUID for "Computer" and is therefore filtering out all other computers.

Resolution
Workarounds: 

  1. To resolve this issue, edit the report in the Advanced Report Builder and edit the SQL directly. The simplest way resolve the issue is to remove the following statement from the SQL statement:

    where/and [ResourceTypeGuid]  = '493435f7-3b17-4c4c-b07f-c23e7ab7781f'

  2. A more elegant fix and necessary in some instances is to edit the following line from:

    [ResourceTypeGuid]  = '493435f7-3b17-4c4c-b07f-c23e7ab7781f'

    to

    [ResourceTypeGuid]  in ('493435f7-3b17-4c4c-b07f-c23e7ab7781f', '2C3CB3BB-FEE9-48DF-804F-90856198B600')

    This works because 2C3CB3BB-FEE9-48DF-804F-90856198B600 is the ResourceTypeGuid for Virtual Machine.