Tech Note 107: Controlling ActiveFactory Trend Using URL Parameters

It is possible to customize the look and behavior of an ActiveFactory Trend control in a browser window using URL parameters. The level of customization includes the Historian connection, the tags displayed, the time period of the trend, the visible toolbars and controls, opening trend files, and more. This tech note describes how to configure some of these options. For more information, please see the Information Server help under ActiveFactory Reporting > Controlling ActiveFactory Trend using URL Parameters.

Introduction to URL Parameters

URL parameters are value-name pairs that follow a question mark (?) in a URL. An equals sign (=) separates the name from the value, and an ampersand (&) separates the parameters. Take for example the following URL:

There are two parameters in the URL above, one named “category”, and the other, “sort”. The value of category is “automation” and the value of sort is “price”. Using parameters you can configure how ActiveFactory Trend looks and behaves in a browser window. With Information Server or ActiveFactory Web Reporting Services (AFWRS) installed, the URL for Trend is:


Where hostname is the name of the host machine, AFWeb is the virtual directory where AFWRS is installed, and Par1, Value1, Par2, Value2 are the configurable parameter names and their corresponding values. Always include the SV=true parameter, otherwise session timeout errors occur.

Connecting to a Historian

The following parameters may be used to configure which Historian Trend connects to.

Server The server name of the Historian.
User The user name used to connect to the Historian. If omitted Windows Integrated Security is used.
Password The password used to connect to the Historian.
BaseURL The base URL to use when accessing the historian via HTTP.
VirDir The virtual directory to use when accessing the historian via HTTP.
Trend uses HTTP to access the Historian whenever you specify values for both the BaseURL and VirDir parameters. Otherwise it uses a regular SQL Server

Specifying the Tags to Show

To specify the tags to show in the trend, use the Tags parameter. To specify multiple tags, separate tag names by semicolons.

Example: http://infoserver/AFWeb/Trend.aspx?Server=historian1&Tags=SysTimeHour;SysTimeMin;SysTimeSec

The following parameters may be used to specify the time period to show in the trend.

Specifying the Time Period

Start The start time in the following format: YYYY-MM-DD hh:mm:ss.s
End The end time in the following format: YYYY-MM-DD hh:mm:ss.s
Duration The duration in seconds.
DateMode Determines whether to show absolute or relative times. Specify 1 for relative time 0 for absolute time.

To specify a time period, use one of the following combinations of parameters:

  • Start time and end time. In this case, the duration parameter is ignored.
  • Start time and duration. If you specify only the start time, but no duration, the duration is set to five minutes.
  • End time and duration. The start time is set to the end time minus the duration. If you specify only the end time, but no duration, the duration is set to five minutes.
  • Duration only. In this case, the start time is set to the current time minus the duration.
  • No parameter. The time period is set to the last five minutes.

All time parameters are relative to the client computer’s time zone.

Example: http://infoserver/AFWeb/Trend.aspx?Server=historian1&Tags=SysTimeSec&Start=2010-08-09+13:00:00&Duration=3600

Note the use of a plus sign (+) in place of a space.

Configuring User Interaction

By default, all user controls in the trend are visible. Use the LockdownOptions parameter to hide individual controls. Pass the values of the controls you want to hide, separated by commas.

TagPickerVisible Hides the Tag Picker.
TimebarVisible Hides the time toolbar.
ToolbarVisible Hides the main toolbar.
AllowGridEditing Hides the Tag List.
AllowContextMenu Hides the right-click menu.

Example: http://infoserver/AFWeb/Trend.aspx?Server=historian1&Tags=SysTimeSec&LockdownOptions=TagPickerVisible,AllowGridEditing

Note that the use of TagPickerVisible counterintuitively makes the Tag Picker invisible. For this reason, you may choose to enter “LockdownOptions=TagPickerVisible=False,AllowGridEditing=False” instead.

Opening a Trend File

Use the FileName parameter to open an existing trend file. Pass the path to the file either as a local path on the client computer or as a URL. To specify a backslash (\), prefix it with another backslash.

Local file example: http://infoserver/AFWeb/Trend.aspx?FileName=C:\\Trends\\Trend1.aaTrend

Remote file example: http://infoserver/AFWeb/Trend.aspx?FileName=http://infoserver/AFWeb/Output/OnDemand/Source/Trend1.aaTrend

Linking a URL Controlled Trend

1. In Information Server Administration, open Portal Configuration, right-click Custom Links, and click Add Node.

2. Give the link a name, enter the full URL of the trend, and click Update Node.

3. Be sure to click the Save link in the top-right corner.

4. A message box should appear after the changes have been saved.

5. The new link should appear under Custom Links.

Created by Jordan Tucker
All Wonderware PacWest Tech Notes are provided “as is” without warranty of any kind.