![]() |
![]() |
![]() |
![]() |
Enterprise User Manual
Chapter 12
Reports and Database Views
PC-Duo Enterprise offers a wide range of reports that summarize the information held for Clients at a Site. These pre-formatted reports are generated using the Crystal Reports run-time, which is included with the Enterprise kit. Reports are listed in the Reports folder of the Console and in the Operation folders with which they are associated.
For example, the Software by Package Report lists all of the applications known to be installed on the selected Clients; the information is ordered by Package, then by Client name. The report includes the Package Status value (used in the change notification feature of the Update Software Inventory Operations) and the date of the last software inventory. It also displays the package version if it is available.
To generate a report:
- In the Console, click the Report you want to run. The Select Clients dialog is displayed.
- In the Select Clients dialog, select the Clients or Group of Clients you want to include in the report, and click the OK button.
The Report is displayed in Print Preview mode. To resize the report, use the zoom buttons in the Report window toolbar.
Customizing Reports
Enterprise enables you to specify destination formats for each Report. You can customize a Report so that it automatically displays data in Print Preview mode, prints, or exports the data.
You can change the destination for a Report using the Customize Database Report dialog. To display this dialog, right-click the Report you want to customize, then choose Customize from the shortcut menu.
Creating Reports
To create new report formats, or to modify existing formats, you must purchase the full Crystal Reports package. This is able to access all the principal fields contained in the Site database, providing a much wider range of reporting and export capabilities.
Database Views
The Database Viewer is a customizable view of the Site database. It gives you on-screen views of selected data. It also enables you to print custom Reports on your inventory and asset data and to save your Views 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 in the Console's Reports folder. You can customize all supplied views.
Modifying Viewer Details
The main area of the Database Viewer displays the results of the specified query. To change the query used to create the View, click the Details button.
The Details section enables you to set the following options:
DSN Name
The Data Source Name, which identifies to the database you want to work with.
User ID
The user name required to access the specified DSN.
User Password
The password required to access the DSN.
SQL Code
Contains a SQL (Structured Query Language) expression that selects the data displayed in the View and controls the order in which it is displayed. To change the data displayed in the View, type a new SQL expression in this field, or click the SQLWizard button to build an expression using the SQLWizard. For more information, see "Using SQLWizard".
Updating the Displayed Results
The Execute SQL button updates the main area of the Database Viewer with results determined by the expression specified in the SQL Code field.
You can also use the [F5] shortcut key, or Execute SQL in the Query menu, 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 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 the selector at the left of the record. An arrow is displayed.
To select multiple adjacent records
Click and drag on multiple record selectors to select the records. Alternatively, click the first record, then hold down the Shift key and click the last record.
To select multiple, non-adjacent records
Hold down the Ctrl key and click each record.
Printing Database Views
Use the Database Viewer's Print facility to generate custom reports.
To print a report:
- Select the records you want to print, then click the Print Report button, or choose Print Report in the File menu. The Print dialog is displayed.
- Select a Print Layout option. Choose:
Multi-column layout to present the data in table format, using one row per record and one column per field.
Multi-line layout to presents each field value column vertically. This option is useful if your fields contain long values.
- If you want to display each record on a separate page, select Page break between records.
- In the Select columns to Print list, select the columns you want to include in the report.
- In the Column Width field, enter the width of each column in pixels.
- Click the OK button. The selected data is displayed in the Print Preview window.
Use The toolbar in Print Preview mode to change the view of the Report and navigate between pages. Click the Print button to print the report.
Saving Database Views in HTML format
When you have selected the data that you want to display in a database view, you can export it to HTML format and make it available to other people across the Internet or an intranet.
To generate an HTML report:
- Click the Select Color buttons and choose the colors for your HTML table.
- If you want to use a tokenized Template File to control the layout of the exported data, type the name of the file in the Template File field, or click the Open button to select the file.
- In the Save to File field, type the name of the file to which you want to save the HTML, or click the Save button to specify the file and location.
- Click the OK button to export the Data View and close the dialog.
You can base exported HTML reports on your own template HTML files, which could contain organization or departmental logos, or customized formatting. You can use the following tokens in an HTML template file:
Token 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 you export a report in HTML format, the Database Viewer automatically adds HTML code for table rows (<TR> tags) and table cells (<TD> tags) to preserve the tabular layout of the Data View. However, 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 can be overwritten by colors specified in the Database Viewer's HTML Report dialog.
To improve control over the display of your data, we recommend adding a stylesheet section to your template page (inside the <HEAD> tag of your HTML file). 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 also enable you to edit and format HTML files.
Database Viewer Command Syntax
The Database Viewer is a Command Launch Operation, which is started from a command line statement. To display the command line for a database view, right-click a view in the Console and choose Customize from the shortcut menu. Database Viewer Operations use the following command line syntax:
DBVIEWER [/nogui] "title=<title>" "user=<username>" "pwd=<password>"
"ODBC=<data source>" "sql=<your sql>" ["template=<template filename>"]
[report=<report filename>/nogui
Exports HTML without displaying the Viewer interface. You must also specify the template filename and report filename parameters (see below).
<title>
Displays the specified text in the title bar of the Database Viewer.
<username>
Specifies the user name required to access the data source.
<password>
Specifies the password required to access the data source.
Specifies the Data Source Name (DSN) of the database that holds the data required in the report.
<your sql>
The SQL (Structured Query Language) statement that selects data for the Database Viewer. You can also specify the name of a text file, with a file extension of .SQL, which contains a SQL statement.
<template filename>
Specifies the name of the HTML template file on which the generated HTML report is based.
<report filename>
Specifies the name of the report file in which the generated HTML report file is saved.
- The quotation marks ( " ) are required. The < and > characters are not part of the command line. You can modify the DSN, user name, password and SQL values when the Database Viewer has loaded.
Using Tokens in Viewer Command Line
You can simplify the Database Viewer syntax using tokens. For example, the $DSNACCESS token can be used to identify the Data Source Name, user name and password in the standard command format for the Database Viewer. These tokens eliminate the need to include user-specific information in the Operation definition.
The example database views all use tokens. (For a list of Operation tokens, see "Using Tokens in Command Launch Operations".)
Scheduling the Generation of Database Views
By customizing the command line for a database view, 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 newclients.sql. The generated report file is called NewClients.html and is based on the template mylayout.html:
DBVIEWER /nogui $DSNACCESS "sql=newclients.sql"
"template=mylayout.html" "report=NewClients.html"You can schedule the customized Operation, by right-clicking the Operation, choosing Submit Job, and specifying the scheduling details. For more information, see "Schedulers".
![]() Vector Networks http://www.vector-networks.com Voice: +44 (0) 1827 67333 Fax: +44 (0) 1827 67068 info@vector-networks.co.uk |
![]() |
![]() |
![]() |
![]() |