Symantec Management Platform (Notification Server)

 View Only

Global Parameters – Pulling Values from the Address Bar 

Jul 13, 2009 05:14 PM

The purpose of this article is to demonstrate the use of global parameters in report building. Global parameters can be used to allow a report to query the address bar for values instead of prompting a user prior to running the report. I have found this helpful on a number of occasions where I have wanted to have a program or ASP page display an Altiris report based on certain criteria without the having to prompt the user.

Creating your Report:

Begin by creating a new report. In this example I will create a simple report that pulls information based on a list of serial numbers that will be pulled from the address bar. The SQL for our report will be:
Select [Serial Number],
       [Asset Type],
       Status,
       Model
From vAsset
Where [Serial Number] in (%SERIALLIST%)

(%SERIALLIST% is the global parameter that we will populate when the report is run.)

Next, create a new Global Parameter. This is done from the main edit page by clicking the New Parameter button:
imagebrowser image


The parameter will have the following attributes:
Name: SERIALLIST
Parameter Type: Basic
Value Type: None

imagebrowser image

Leave everything else as default, making sure that the Prompt User checkbox is not checked. We don’t want the report to require user interaction. You can change the name of your variable if you wish, but it is very important that you select “None” as the value type. If this is not set to “None”, Altiris will place quotes around the value that is passed in and that will break your SQL query.

The report is now complete. Next we will discuss how to run it.

Running your Report:

Usually to run a report, the user is required to click on the “Run this report” button:

imagebrowser image

In order to make this report run without that sort of interaction, we need to get the URL that should be placed in the address bar to make our report run automatically.

To get the URL, run your report in a new window by clicking the "run this report in a new window" at the top:
imagebrowser image

(Note, it will return an error because we have not provided it with the SERIALLIST parameter that it is looking for. This is OK.) Once the report has run and returned the error, copy the URL from the address bar at the top of the browser. It will look something like this:
http://its-altirisrpt/Altiris/NS/Admin/Reports/report_summary.aspx?Guid=76b95778-2d56-47ec-8417-67687b9ebb65

This is the URL to your report. The next step is to incorporate the SERIALLIST global parameter that we set up into the URL. Parameters are appended to the end of the URL by adding a “&” then the parameter, followed by an “=” and then the values you want to pass in. So in our case, the URL could look something like this:
http://its-altirisrpt/Altiris/NS/Admin/Reports/report_summary.aspx?Guid=76b95778-2d56-47ec-8417-67687b9ebb65&SERIALLIST='7sf9p81'

Notice that the value you pass in has to be in single quotes so it is SQL friendly.

Placing this in my address bar pulls up the following results:
imagebrowser image

You may have noticed that in our SQL we used “Where [Serial Number] in” in our query. This allows us to feed multiple serial numbers in all at the same time. Here is an example of what the URL could look like to pull back results on multiple machines at once:
http://its-altirisrpt/Altiris/NS/Admin/Reports/report_summary.aspx?Guid=76b95778-2d56-47ec-8417-67687b9ebb65&SERIALLIST='7sf9p81','c0b00b1','4k88v51'

All we are really doing is giving that SERIALLIST parameter a comma separated list of values. The results come back like this:
imagebrowser image


That is all there is to it. Now external applications and web pages can run customized reports by passing values in through the address bar! 

I hope this has been helpful.

Statistics
0 Favorited
2 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Dec 24, 2010 01:09 PM

Nevermind, it is here:

http://www.symantec.com/business/support/index?page=content&id=HOWTO9676&actp=search&viewlocale=en_US&searchid=1293213188270

 

The brackets ( [ and ] ) were the key thing I was missing.

Dec 24, 2010 12:50 PM

I would love to know how to do this in Altiris 7 reports...havent' figured it out.

Jul 21, 2009 09:28 AM

Sorry,  I should have numbered the steps.  If I count the SQL as step one, creating the global parameter as step 2, then step three would be the step where you get the URL to your report?  Just in case, I will expound on that.

Normally reports are run in a frame in the notification console.  This means that you won't actually see the URL that is pulling up the report in the address bar unless you run the report in a new window.  You perform that step by clicking the button I provided a screenshot of.  When the new window opens, you will see the address or URL of that particular report at the top of the screen in the address bar. 

This is the address that you will append parameters and values to.

Please let me know if there is something else that is not clear.

Thanks!

Jul 19, 2009 01:38 AM

 think i need some clarification on step 3

Related Entries and Links

No Related Resource entered.