Creating templates


Use a template to automate the process of drawing a set of graphs. When you save a template, Visualizer saves only the working context which includes the graph types, settings, and page layout without actual data.

When you open a new project using a template, Visualizer uses the contextual information associated with the template to draw graphs. Since graphs aren't stored with templates, template files take up less space than project files.

Projects re-create a set of graphs representing specific data. In templates, you can specify variables such as the last seven days, last month, week days, and so on. Using variables, your data is always current.

Printing daily graphs without using a template

There are two ways to graph yesterday's data, and print them on a daily basis. The following scenario describes how to generate a set of graphs without a template:

  1. Start Visualizer.
  2. Select the data source.
  3. Select Database > Detail.
    The Data Selection dialog box is displayed.
  4. Select the data for the previous day. (The default is the day before the last day in the database.)
  5. Select Window > Page Layout.
  6. Select a layout (or use the default, 3x3).
  7. Draw the graphs one-by-one.
  8. Select Window > Page Select > All Pages.
    Verify the correct layout of the pages.
  9. Print the pages.

Printing daily graphs using a template

You can also define a template with graphs and page layout. You can specify a variable date so that Visualizer always selects the last date in the database.

  1. Start Visualizer.
  2. Select the data source.
  3. Select Database > Detail.
    The Data Selection dialog box is displayed.
  4. Enter the variable <LAST>.
  5. Select Window > Page Layout.
  6. Select a layout (or use the default, 3x3).
  7. Draw the graphs one-by-one.
  8. Select Window > Page Select > All Pages.
    Verify the correct layout of the pages.
  9. Print the pages.
  10. Select File > Save Template As to save the project as a template.
  11. Select File > New Project > From Template.
  12. From the Open Template dialog box, select a template.
  13. Print the pages.

In this example, Visualizer automatically accesses the database and selects the last date for which there is data. Visualizer then draws all the graphs and puts them on the selected page layout. Visualizer can draw only template graphs if the associated database is available.

To shorten the process, define the template as a shortcut on the Windows desktop.

Creating and saving templates

Typically when you define and use a template, you're drawing the same set of graphs for different dates. This section describes how to define variable dates and then save the template.

You can use the same techniques to vary other data, such as systems, workloads, or devices.

To create a template

  1. Select a data source.
  2. Select Database > Detail to display the Data Selection dialog box. Then do one of the following:
    • To specify a variable date, such as last date or next to the last date, go to Step 3. Keep in mind that date variables are relative to either the first or last day in the database. Also, you must always enclose any date variable you use within angle brackets (< >).
    • To define the template so that the system prompts you to choose a date each time you open the template, go to Step 5. This is useful if you need to generate graphs for a time that cannot be defined by a variable (for example, three days ago, a week ago, or a month ago).
  3. In the Date box, enter one of the variables listed as follows. You can use groups of dates only in the Date box:

    Variable

    Template used

    <ALL>

    Whole collection of dates (all dates)

    <FIRSTnDAYS>

    First n number of days

    <LASTnDAYS>

    Last n number of days

    <LASTMONTH>

    Last month, beginning with the previous month in the database

    <LASTWEEK>

    Last Saturday in the database and counts back seven days from there (only works for data collected seven days a week)

    <LASTWKDAYS>

    Last Friday in the database and counts back to Monday

    <MONTH>

    Current month, beginning with the current month in the database

    <WKDAYS>

    Last Monday, includes that Monday and everything up to and including Friday

    <WEEK>

    Last week, beginning with the most recent Sunday

    Use the following variables for Individual dates or objects:

    <FIRST>

    First date

    <NEXT>

    Second date (next to first)

    <NEXTn>

    Next n date relative to the first

    <NEXTLAST>

    Next to the last date

    <NEXTLASTn>

    Next to the n last date, relative to <LAST>

    <LASTnDAYS>

    Last n number of days

    <LAST>

    Last date

    Use the following variable for an individual date or object:

    <LASTDAYn>

    Last day with n number of intervals.

  4. Click OK. Go to Step 7.
  5. Highlight the Date, define a group of one or more dates, and choose the group. For more information, see Creating-and-Maintaining-Groups.

    The dates you put into the group do not matter. A date group ensures that the product displays the Data Selection dialog box when you open a template. From this dialog box, you can choose data before drawing template graphs.

  6. Click OK. Go to Step 10.
  7. In the Start Time field, enter one of the variables listed in the following table:

    Variable

    Template used

    <FIRST>

    First time interval

    <SECOND>

    Second time interval (next to first)

  8. In the End Time field, enter one of the variables listed in the following table:

    Variable

    Template used

    <LAST>

    Last time interval

    <NEXTLAST>

    Next to the last time interval

    <LASTSAME>

    last time interval for the date specified

  9. Click OK.
  10. Draw all graphs you want to include in the template, and put them on pages. When you open a template, the graph is where it was when you saved the template, whether on a page or on the main window.

To save a template

  1. Choose File > Save Template As.
    The Save Template As dialog box is displayed.
  2. Enter a name for the template in the File Name text box. The default extension for template files is .bvt.
    Other options let you change drives and directories, and specify the type of file displayed on the file selection list.
  3. Click OK.

Making templates accessible

On Windows platforms, you can add a template to the Start or Programs menu, making it easier to access and run. This is especially important if you rely heavily on templates for reporting purposes.

  1. Click Start, and then point to Settings.
  2. Click Taskbar, and then click the Start Menu Programs tab.
  3. Click Add, and then click Browse.
  4. Locate the template ( *.bvt file) you want to add, and then double-click it.
  5. Click Next, and then double-click the menu where you want the template to be displayed.
  6. Type the name that you want to see on the menu ( <template_name>.bvt), then click Finish.
  7. If you are prompted, choose an icon, click it, and then click Finish.
Warning

Note

You can also add a template to the top of the Start menu just by dragging the template's icon to the Start button. 

Using templates to pass date qualifications and parameters

WebPost tries to make the last project posted the default URL, so you have to manually specify unique names. By manually editing the keystroke file produced when you run the Graphics event in Preview Mode, you can post data to a specified Web server for up to one year without overwriting file names. The following procedures describes how you can enable date qualification in posted or exported file names:

  1. From Automator menu, select Run > Preview Mode to produce the following keystroke file in c: \ temp \auto.key :

    {Defaults}
    {OptionsConfirmNone}
    {OverrideDATA} DSN=ODBCDataSource
    {FileNewFrom}c: \best1vis \ template.bvt
    {FileWebProject} {TempDir} WebPostServerTag
    {HardExit}

    This reads the template template.bvt , posts it as templat.htm in the WebPost.dir subdirectory of the temp directory (with associated files templaNN.htm, templaNN.jpe, templaNN.jpg, and templaNN.png).

  2. Use the special keys {Date} or {Date:pattern} to save the data to a file name formed from the server tag and the name of the saved project from the current date. For example, the following saves a base file named xxMMDD where xx is a two-character tag used to distinguish different systems plus the date. This enables you to post a full year to to the same tag without overwriting file names.

    {FileSaveAs} xx {Date}
Warning

Note

The Graphics Export As html allows you to use the {Date} syntax in the target file path without editing a keystroke file.


Alternatively, use the following to write files "xxMMDD" to one tag for each weekday – MonServerTag, TueServerTag, and so on.

{FileSaveAs} xx {Date}
{FileWebProject} {TempDir}


Valid date patterns include the following Keystroke file part definitions:

Part

Definition

m

Month number, no leading zero

mm

With leading zero

mmm

Jan, ...

mmmm

January, ....

d

Day of month, no leading zero

dd

With leading zero

ddd

Sun, ...

dddd

Sunday, ...

y

Day of the year (1-366)

w

Day of the week (1-7)

ww

Week of the year (1-52)

q

Number of the quarter

yy

Two-digit year

yyyy

Four digit year

{Date} behaves like {Date:mmdd}.

Warning

Note

Date keys can also appear in pathnames for {FileExport}, {FileTemplate}, and {FileSaveAs}. 

Using more than one DSN in a template

If you want to use more than one DSN in a template, you must override the Automator's DSN override. This requires editing a keystroke file and invoking the keystroke file in the Graphics event.

  1. Highlight the existing Graphics event and select Run > Preview Mode to produce a keystroke file in c: \temp \auto.key.

    In the following example, the template exported html from twodsns.bvt with the Automator using the BDSDemo DSN:

    {Defaults}
    {OptionsConfirmNone}
    {OverrideDATA} "DSN=BDSDemo;DBQ=C:\Program Files\BMC Software\Visualizer\DB\bdsdemo.mdb;DefaultDir=C:\Program Files\BMC Software\Visualizer\DB;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;"
    {FileNewFrom} "Z:\vis\VBvis\Run\twodsns.bvt"
    {FileExportProject} "Z:\vis\VBvis\Run\twodsns.htm"
    {PendPost}
    {HardExit}
  2. Replace the first three keystroke command s (the shaded area in the preceding sample) with a single keystroke line command, which removes the confirmation requirement. You can also remove {HardExit} since it is reproduced in the Automator-generated shell. The edited version of the file, saved as override_override.key , reads:

    %on%d{Enter}
    {FileNewFrom} "Z:\vis\VBvis\Run\twodsns.bvt"
    {FileExportProject} "Z:\vis\VBvis\Run\twodsns.htm"
    {PendPost}
  3. Change the Graphics event so that it uses the keystroke file, override_override.key, instead of exporting from the template twodsns.bvt. When you preview the edited event, Automator produces the following auto.key file:

    {Defaults}
    {OptionsConfirmNone}
    {OverrideDATA} "DSN=BDSDemo;DBQ=C:\Program Files\BMC Software\Visualizer\DB\bdsdemo.mdb;DefaultDir=C:\Program Files\BMC Software\Visualizer\DB;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;"
    {SetKEYS} "C:\TEMP"
    {Nest} "override_override.key"
    {HardExit}

    The Automator still points to BDSDemo, but the nested keystroke file, override_override.key, overrides this by changing the confirmation state. This works as long as the DSNs saved in the template are correct for the context in which the template is regenerated.

    Warning

    Note

    You must save DSN passwords in the template. Make sure Visualizer Options > Save ODBC Password is enabled when the template is saved. Scheduled runs fail if the DSN requires a password and it has no t been saved with the template.

    Related topic


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

Visualizer 4.2.07