
Enterprise User Manual
Chapter 6
Reports and Database Views
PC-Duo Enterprise offers a range of reports which summarize categories of information for the Nodes and Groups at your Site. For example, the Software by package Report lists all of the applications known to be installed on the selected Nodes. It is ordered by Package, then by Node name.
The report includes the Package Status value, as used in the change notification feature of the Software Inventory Operation, as well as the date of the last Software Inventory scan. It also displays the application's package version, if known.
These pre-defined, pre-formatted reports are generated using the Crystal Reports run-time, which is included with the PC-Duo Enterprise kit. Reports are listed in the Operations View's Reports tab.
To generate a report:
- Select the individual Node, selection of Nodes, or Group to be featured in the Report.
- In the Console's Operations View, select the Reports tab.
- Double-click on the Report Operation you want to run. The Report is displayed in Print Preview mode. To resize the report, use the zoom buttons in the Report window toolbar.
- The default Report destination is Print Preview mode. However, you can customize Report Operations to specify an alternative Report destination for each individual report.
The Reports present the data stored in your PC-Duo Enterprise Site Database. Therefore, the accuracy of the Report data is dependent upon performing regular Hardware Inventory and Software Inventory scans and publishing their Results to the Database.Customizing Report Operations
PC-Duo Enterprise offers reporting flexibility by enabling you to specify destination formats for each Report Operation. You can customize a Report so that when executed, the Report is displayed in Print Preview mode, or Print, or is exported.
When using Print Preview you may find that you get a clearer view if you maximize the report window.
You can change the report destination for a Report using the Customize Database Report dialog. To display this dialog, right-click on the Report Operation you want to customize, then choose Customize from the shortcut menu.
Creating Your Own Reports
To create new PC-Duo Enterprise report formats, or modify the existing report formats, you must purchase the full Crystal Reports package.
The full Crystal Reports product is able to access all the principal fields contained in the Database, providing a much wider range of reporting and export capabilities. This also applies to any other database product which supports ODBC.
Alternatively, you can use the Database Viewer Operation to create customizable, printable reports based on your Site Data. The Database Viewer can also export data in HTML format. For more information, see "Database Views".
Database Views
PC-Duo Enterprise's Database Viewer gives you a customizable, immediate view of the Site Database. As well as giving you on-screen views of specified data, the Viewer's printing facility offers a flexible method of generating custom Reports on your PC-Duo Enterprise inventory and asset data. You can also save your Data View in HTML format.
The Database Viewer uses SQL (Structured Query Language) to retrieve specific items of data. A range of predefined Database Views are supplied with PC-Duo Enterprise in the Views tab of the Operations View. All supplied Views can be customized.
Modifying Viewer Details
The main area of the Database Viewer displays the results of the specified query. To change the query on which the View is based, click the Details button.
The Details section enables you to set the following options:
DSN Name
This is the Data Source Name, which identifies to the Database you want to view.
User ID
The user name required to access the specified DSN.
User Password
The password required to access the DSN.
SQL Code
Enter your SQL (Structured Query Language) code here. The SQL code specifies which tables, records and fields are displayed, and in their order.
If you are unfamiliar with SQL, click the SQL Wizard button to launch PC-Duo Enterprise's SQL Wizard utility. The SQL Wizard helps you to create database queries using a simple, natural language style interface.
The Paste SQL button enables you to paste SQL code from the clipboard into the SQL Code box so you can import SQL code from the SQL Wizard, Dynamic Group definitions, other Database Views and third-party tools.
Updating the Displayed Results
The Execute SQL button updates the main area of the Database Viewer with results based on the specified SQL Code.
You can also use the [F5] shortcut key, or the Query, Execute SQL menu command, to update the results.
Modifying Database Views
To change the order of columns in the Viewer results, click and hold the mouse on the column you want to move, then drag the column to its new position.
To resize a column, point to the right edge of the column so the cursor changes to a double-arrow symbol, then drag the column edge to the new position.
Records in the Database Viewer can be sorted by a particular column. To change the sort order of records, click on a column heading.
Selecting Records in the Results
Each row in the Data View represents a distinct record of associated data. You can select individual or multiple records to be printed using the following techniques:
To select an individual record
Click on the appropriate record's selector box (the gray box to the left of a row.) After selecting the record, an arrow symbol is displayed in the box.
To select multiple adjacent records
Click and drag on multiple record selectors to select the records.
Alternatively, to select all the records in the series, click on the first record in a series, then hold down the Shift key and click on the last record.
To select multiple, non-adjacent records
Hold down the Ctrl key and click each record.
Printing Database Views
The Database Viewer's Printing facility offers a flexible method of generating custom reports.
Use the Print Report button or the File, Print Report menu command to display the selected data in Print Preview mode. You can also use the shortcut key combination [CTRL]+P.
Note that only the selected records are printed.
After choosing one of the print options, the Print dialog is displayed.
Using the Print Dialog
The Print dialog enables you to choose a layout and specify which columns you want to print. When using the Print Dialog, make sure the appropriate Print Layout option is selected:
- The Multi-Column layout option presents the data in a table format, using one row per record and one column per field (as with the Database Viewer's Data View).
- The Multi-Line layout option presents each field value column vertically. This option is useful if your fields contain long values.
If you want each record to appear on a separate page, select the Page break between records option.
In the Select columns to Print box, select / deselect the appropriate columns (fields) you want to present in the report. Only the selected (highlighted) columns are printed.
If necessary, amend the Column Width value. The default value is 100.
Previewing Printed Reports
After specifying the Print options, the data is displayed in Print Preview mode. The toolbar in Print Preview mode enables you to change the view of the Report and navigate between pages.
The appearance of the printed data depends on the settings specified in the Print dialog.
Saving Database Views as HTML
You can use the Save As HTML button or the File, Save As menu command to export the current data view in HTML format. After choosing to save the data view as HTML, the HTML Report dialog is displayed.
To generate an HTML report from the Database Viewer:
- Use the two Select Color... drop-down buttons to specify color-coding for your HTML table.
- If you want to use a tokenized Template File for the exported data, click the button to the right of the text box and select the file. Click here for more information on HTML Templates.
- Specify the file name of your HTML page in the Save To File box (use the button on the right to browse to this location).
- Click the OK button to export the Data View as a HTML Report.
You can base exported HTML reports on your own template HTML files, which could contain your organization or departmental logos, or your in-house report formatting. The following tokens can be used in a HTML template file:
Token Name Description $TITLE$ Report Title $DATE$ Date on which the report was generated $TABLEHEADS$ Header columns of the table $TABLEDATA$ Table dataUsing Tokens in HTML Files
When exporting a HTML Report, the Database Viewer automatically adds HTML code for table rows (<TR> tags) and table cells (<TD> tags). This preserves the tabular layout of the Data View.
This means that your $TABLEHEADS$ and $TABLEDATA$ tokens must be enclosed in HTML table tags, as shown here:
<TABLE> add tokens here </TABLE>Keep this in mind when creating HTML templates, as the Database Viewer does not insert the <TABLE> tags for you.
Remember that your table formatting could be overwritten by colors specified in the Database Viewer's HTML Report dialog.
If you are familiar with HTML, we recommend adding a stylesheet section to your template page (inside the <HEAD> tag of your HTML file), for maximum control over your layout. Many examples and introductions to cascading style sheets (CSS), which form part of the HTML4.0 specification, are available online.
If you are not familiar with HTML, you can reformat an HTML Report file in an authoring tool such as Microsoft FrontPage or Macromedia Dreamweaver. Many word processing applications enable you to open, edit, format and save HTML files.
Database Viewer Command Syntax
The Database Viewer is an external operation, which is started from a command line statement. To view the command line for a Database View Operation, right-click on the operation in the Console and choose Customize.
The command line syntax for the Database Viewer from the command line is shown is as follows:
DBVIEWER [/nogui] "title=<title>" "user=<username>" "pwd=<password>" "ODBC=<data source>" "sql=<your sql>" ["template=<template filename>"] [report=<report filename>]
- The quotation marks ( " ) are essential. The < and > characters are not part of the command line: substitute the appropriate values for the parameter text.
Once the Database Viewer has loaded, you can modify the DSN, user name, password and SQL values.Using Operation Tokens in Viewer Command Line
You can simplify the Database Viewer syntax using Operation tokens. For example, the token $DSNACCESS can be used to identify the Data Source Name, user name and password in the standard command format for the Database Viewer and SQL Wizard utilities.
Such tokens eliminate the need for hard-coded, and relatively visible, user name and password information being stored in the operation definition.
The supplied example Database Views all use tokens. For a complete list of operation tokens, see "Using Tokens in Command Launch Operations".
Scheduling Database View Report Generation
By customizing the command line for a Database View operation, you can automate the generation of HTML reports. Command line options are described in "Database Viewer Command Syntax".
For example, the following command line options hide the Database View interface and query the current site using the SQL code specified in the file newnodes.sql. The generated report file is called NewNodes.html and is based on the template mylayout.html:
DBVIEWER /nogui $DSNACCESS "sql=newnodes.sql" "template=mylayout.html" "report=NewNodes.html"Such a customized operation can be scheduled by right-clicking on the operation, choosing Submit Job, and then specifying the scheduling details.
For more information about scheduling jobs, see "Scheduling Operations as Jobs".
![]() Vector Networks http://www.vector-networks.com Voice: +44 (0) 1827 67333 Fax: +44 (0) 1827 67068 info@vector-networks.co.uk |