The following instructions describe how to use drop-down lists in a custom SQL report in the Symantec Management Platform 7.x Console. This includes how to populate the drop-down lists manually and automatically by providing example instructions for an example custom SQL report. For additional information on working with custom reports, refer to the Symantec Management Platform User Guide:
Symantec Management Platform 7.1 SP2 User Guide
Part 1: Add a Report Parameter
For this part, two report parameters will be added, "AssetStatus" and "CostCenter".
Manually Add/Edit Drop-down Values: AssetStatus
Manually adding values for the drop-down list is useful for when there is a small amount of possible values to be used or the values are desired to be enforced for what can be selected by the user.
- In a Symantec Management Platform Console, click on the Reports button > Reports.
- Right click on the Reports top-most folder and choose New > Report > SQL Report. Note: If an existing custom SQL report or cloned out of box SQL report is to instead be used, click on its Edit button instead of creating a new SQL report and then skip to step 4.
- Type a report name for the report in its Name field. For example, "Assets by Status and Cost Center".
- Click on the Report Parameters tab.
- Click on the Add button > New Parameter.
- In the Parameter section, in the Name field, type a name. For example, "AssetStatus".
- In the Description field, type a description. For example, "Asset Status".
- If the parameter is to be required, click to enable the Parameter Required check box.
- In the Type field, choose Basic GUID Parameter. Note: The Default Value and Test Value fields are then populated with a GUID with all zeroes.
- In the Default Value field, enter the desired starting GUID (optional). For example, "0A0203A5-D2B6-49F1-A53B-5EC31A89437C" for the Active status. Then, when the report is first opened, all Active assets are displayed by default until the user changes the Status drop-down list value and clicks on the Refresh button.
- In the Value Provider section, in the Name field, choose Drop-down List Value Edit Control.
- In the Tooltip and Label Text fields, type a tooltip and label text names. For example, both can be "Asset Status".
- In the Manually Add/Edit Drop-down Values section, click on the "v" expand button to open the section (it is closed by default).
- In the Display field, type a name. For example, "Active".
- In the Value field, type a value. For example, "0A0203A5-D2B6-49F1-A53B-5EC31A89437C".
Tip: The value for these examples is required to be a GUID. The user must investigate which GUID to use for which name type. For example, the Active status GUID is "0A0203A5-D2B6-49F1-A53B-5EC31A89437C". This can be found by using the following SQL script, such as to look through the Item (or any other) table:
SELECT Guid, Name, Description
WHERE Name = 'Active'
This SQL query can return more than one result. The user would have to determine which GUID therefore is the correct one to use. Because of this, some experimentation by the user may be necessary to obtain the correct GUID for each value that is added.
- Click on the Add button.
- Continue adding desired values to the Display and Value fields. For example, add the following Display and Values to add all out of box Status types:
In Stock 1C139F6C-F210-4002-90D0-4DFAF98D5FA4
On Order FBF4A5D6-C649-406E-B919-E3C83AFA039B
Returned to Lessor 588224BA-16C7-4F84-B808-EF895CE5F759
And then add in a custom catch-all choice:
Note: Manually added items cannot be resorted after being added. If a specific order is desired, these must be added as desired in the order they are to appear in. If these are already added out of order, the only way to change this is to delete the items and re-add them correctly.
Upon completion of all of the above steps, using the Manually Add/Edit Drop-down Values method, the Parameter Editing\Creation window will look like Figure 1, below:
Figure 1: Example Report Parameter window using manually added values
- Click on the OK button.
Add Drop-down Values From A Report: CostCenter
Using a report to automatically populate values is useful if there is a large amount of or changing data. For example, Cost Centers, Departments or Locations are good candidates to use a report for with this method.
- Repeat steps 1 through 5 from the Manually Add/Edit Drop-down Values: AssetStatus section to create a second new report parameter.
- In the Parameter section, in the Name field, type a name. For example, "CostCenter".
- In the Description field, type a description. For example, "Cost Center".
- Repeat steps 8 through 11 from the Manually Add/Edit Drop-down Values: AssetStatus section. Leave, however, step 10's default GUID as the zero GUID that was added by default, not replace it with a specific Cost Center GUID.
- In the Tooltip and Label Text fields, type a tooltip and label t names. For example, both can be "Cost Center".
- In the Add Drop-down Values From A Report section, click on the "v" expand button to open the section (it is closed by default).
- Click on the Select a Value link in the Select Report field.
- Select a report that will provide the expected values for the parameter. For example, select All Cost Centers. Note: If a report does not exist that does this, or if one does but after selecting it, the Report Field to Display does not populate, the user will need to create their own custom report for this express purpose.
- Click on the OK button.
- In the Report Field to Display field, choose a value.For example, Name.
- In the Report Field to Use as Value field, choose a value. For example, _ItemGuid. Upon completion of all of the above steps, using the Add Drop-down Values for A Report method, the Parameter Editing\Creation window will look like Figure 2, below:
Figure 2: Example Report Parameter window using report (automatic) added values
- Click on the OK button.
Part 2: Add a Query Parameter
- Click on the Data Sources tab.
- Click on the Query Parameters tab.
- Click on the Add button and then pick the name of the report parameter in Part 1, step 7 from the Manually Add/Edit Drop-down Values: AssetStatus section. Note: If the user later changes the report parameter values, it is recommended to then go to the Query Parameters tab, delete the prior reference to the report parameter and then re-add it, as report parameter changes do not carry over to already created Query Parameters based off of them.
- Repeat steps 1 through 3, but pick the name of the report parameter in Part 1, step 2 from the Add Drop-down Values From A Report: CostCenter section.
- Two query parameters are now added, one for each of the report parameters from Part 1.
Part 3: Add the parameter to the SQL code
- Click on the Parameterised Query tab.
- Type in a SQL script to enable the report to show the expected values. This will then reference the parameters via variables. Please Note: Symantec Technical Support is unable to write SQL queries for the customer. Please refer to your DBA for SQL script writing assistance.
DEClARE @AssetStatus UNIQUEIDENTIFIER
SET @AssetStatus = '%AssetStatus%'
SELECT va._ResourceGuid '_ItemGuid', vi.Name 'Asset', va.[Asset Type], vc.Name 'Cost Center', va.[Serial Number], va.[System Number], va.Barcode, va.Status
FROM vAsset va
JOIN vItem vi
ON vi.Guid = va._ResourceGuid
JOIN ResourceAssociation ra
ON ra.ParentResourceGuid= va._ResourceGuid
JOIN vCostCenter vc
ON vc._ResourceGuid = ra.ChildResourceGuid
WHERE (@AssetStatus = '00000000-0000-0000-0000-000000000000' OR @AssetStatus = va._AssetStatusGuid)
AND ra.ChildResourceGuid = '%CostCenter%'
ORDER BY vi.Name
Note: The name any parameter must be spelled exactly as it was entered on the Report Parameter window. This includes capitalization. For example, "Assetstatus" and "assetstatus" would not be recognized, and a Data Source error will occur when trying to save the report.
- Click on the Save Changes button. The report is then processed and results are displayed. From the above examples, this will then display all assets with a status of Active after the user selects a cost center and clicks on the Refresh button. Note: When changing report parameter values in the drop-down lists, after changing the value, click on the report's Refresh button to refresh the results list.
- If the above examples do not work, double check that everything as shown was entered exactly, or try importing the included sample custom reports, which includes the above examples in them.
- Review the Altiris Server logs to troubleshoot any errors that occur, such as Data Source errors (invalid SQL script).
How to enable double click editing of assets in a custom report
How to add columns or tables to a custom SQL report
Right click menu fails to work when using a custom report or custom resource
Unable to right click or create/edit certain Configuration Items reports, such as Services
How to create a custom report for assets
Creating and modifying custom Notification Server reports
When right-clicking a resource: An error occurred on the page. Please check the log for more details
Errors occur while editing a cloned or custom report
Example custom report that demonstrates how to use dropdown lists