HP ServiceManager Report Writer Guide
HP ServiceManager Report Writer Guide
For the Windows®, HP-UX, AIX, Linux and Solaris Operating Systems
Copyright Notices
© Copyright 1996-2007 Hewlett-Packard Development Company, L.P.
This product includes cryptographic software written by Eric Young ([email protected]). This product includes software
written by Tim Hudson ([email protected]). Smack software copyright © Jive Software, 1998-2004. SVG Viewer, Mozilla
JavaScript-C (SpiderMonkey), and Rhino software Copyright © 1998-2004 The Mozilla Organization. This product includes
software developed by the OpenSSL Project for use in the OpenSSL toolkit. (http:// www.openssl.org). OpenSSL software
copyright 1998-2005 The OpenSSL Project. All rights reserved. This project includes software developed by the MX4J project
(http://mx4j.sourceforge.net). MX4J software copyright © 2001-2004 MX4J Team. All rights reserved. JFreeChart software ©
2000-2004, Object Refinery Limited. All rights reserved. JDOM software copyright © 2000 Brett McLaughlin, Jason Hunter.
All rights reserved. LDAP, OpenLDAP, and the Netscape Directory SDK Copyright © 1995-2004 Sun Microsystems, Inc.
Japanese Morphological Analyzer © 2004 Basis Technology Corp. The Sentry Spelling-Checker Engine Copyright © 2000
Wintertree Software Inc. Spell Checker copyright © 1995-2004 Wintertree Software Inc. CoolMenu software copyright © 2001
Thomas Brattli. All rights reserved. Coroutine Software for Java owned by Neva Object Technology, Inc. and is protected by
US and international copyright law. Crystal Reports Pro and Crystal RTE software © 2001 Crystal Decisions, Inc., All rights
reserved. Eclipse software © Copyright 2000, 2004 IBM Corporation and others. All rights reserved. Copyright 2001-2004
Kiran Kaja and Robert A. van Engelen, Genivia Inc. All rights reserved. Xtree copyright 2004 Emil A. Eklund. This product
includes software developed by the Indiana University Extreme! Lab (<http:// www.extreme.indiana.edu/>). Portions copyright
© Daniel G. Hyans, 1998. cbg.editor Eclipse plugin copyright © 2002, Chris Grindstaff. Part of the software embedded in this
product is gSOAP software. Portions created by gSOAP are copyright © 2001-2004 Robert A. van Engelen, Genivia Inc. All
Rights Reserved. Copyright © 1991-2005 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://
www.unicode.org/copyright.html.
Trademark Notices
Java™and all Java based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the
U.S. and other countries.
Microsoft® and Windows® are U.S. registered trademarks of Microsoft Corporation.
Oracle® is a registered US trademark of Oracle Corporation, Redwood City, California.
UNIX® is a registered trademark of The Open Group.
2
Documentation Updates
This manual’s title page contains the following identifying information:
• Software version number, which indicates the software version
• Document release date, which changes each time the document is updated
• Software release date, which indicates the release date of this version of the software
To check for recent updates, or to verify that you are using the most recent edition of a document, go to:
www.hp.com/go/hpsoftwaresupport
You will also receive updated or new editions if you subscribe to the appropriate product support service.
Contact your HP sales representative for details.
3
Support
Please visit the Hewlett-Packard Software support web site at:
http://www.hp.go/hpsoftwaresupport
This web site provides contact information and details about the products, services, and support that HP
offers.
HP online software support provides customer self-solve capabilities. It provides a fast and efficient way to
access interactive technical support tools needed to manage your business. As a valuable support customer,
you can benefit by using the support site to:
• Search for knowledge documents of interest
• Submit enhancement requests online
• Download software patches
• Submit and track progress on support cases
• Manage a support contract
• Look up HP support contacts
• Review information about available services
• Enter discussions with other software customers
• Research and register for software training
Most of the support areas require that you register as an HP Passport user and sign in. Many also require a
support contract. To find more information about access levels, go to:
h20230.www2.hp.com/new_access_levels.jsp
To register for an HP Passport ID, go to:
h20229.www2.hp.com.passport-registration.htm
4
Contents
Overview . . . . . . . . . . . . . . . . . . . . . . . . . 11
Background Processing . . . . . . . . . . . . . . . . . . . 20
Viewing reports . . . . . . . . . . . . . . . . . . . . . . 23
|| 5
HP Service Manager
6|
Report Writer Guide
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
|7
HP Service Manager
8|
Report Writer Guide
1
Report Writer Basics
Report Writer is a component of the HP Service Manager Tailoring tools. You can
use it to query for existing reports, and to create simple or complex reports that you
can modify at any time.
Overview
Report Writer enables you to define selection, totaling, and report form criteria to
create listings from one or more database files, using one database file as the
primary file. The reports may be simple or complex, and can be modified at any
time to add complexity or clarify details. Report Writer allows for complete
user-definition.
You can base a report on one or more database tables. If you use several tables, you
will need to specify a primary file. You can define the data selection and totaling
criteria as well as the forms used to display the report.
Overview | 11
HP Service Manager
Click Search or press Enter without specifying any values, to pull up a list
of existing report records.
Type an existing report name or primary file name and click Search or
press Enter, to find reports with that match your search criteria.
If the specified query produces only one record, that report record opens
on the Report Maintenance form.
If the specified query selects more than one record, Report Writer displays
a list of report records. Scroll through the list. Place your cursor on any
record and double-click to select the record.
The available options may vary depending on the preferences you have selected,
the record you select, and your permissions.
4 Type new report name over the existing name in the Name field. This must be
a unique name.
Select Abort Del to end the delete process and exit to the report form.
Select Rpt Record to delete only the report record.
Select Rpt Fmt to delete the report record and its report forms.
Select All to delete the report record, report forms, and all associated
application panels. This option is only available for manual reports.
Note: When you delete report forms, be sure that the forms defined in this report
are not required in any other report that is used.
2 Type a unique name for the new report in the Report field. Do not use special
characters other than "." or blank spaces.
Note: Use the text before the first "." to indicate the primary file for the report. If
there are no ".", HP Service Manager does not associate a primary file with
the report.
If the report form already exists, Report Writer displays it in the Report
Maintenance form to enable you to make changes, or copy data to create a
new report.
If the report form does not exist, Report Writer displays the new report in
the Report Maintenance form and populates the Name, Primary File,
Header, and Details fields based on the data you entered.
5 Fill in the fields and click OK. For more information, see The Report
Maintenance form on page 12 and The Report Maintenance Editing form on
page 16.
Note: To set the width of a report, complete the Page Width field of the Client
Printing structure in the user's operator record. For more information, refer
to the HP Service Manager Help.
The maximum width of a report is 132 characters. If the forms defined for a
report exceed this limit, Report Writer generates them with the specified
width. However, when passing the report to the printer, it truncates them to
132 characters. You can change this setting in the config record for the
printer used to print the report.
6 Create the header and detail forms for the report, if they do not already exist.
For more information, see How do I create or edit report forms? on page 32.
The available options may vary depending on the preferences you have selected,
the record you select, and your permissions.
Cancel Cancels any changes and returns you to the previous screen.
2
Running Reports
1 Access the report you want to run. See How do I access a report? on page 11.
2 When you have access to the report form, check the information to ensure that
it is correct. Click Edit to make any necessary modifications.
4 From the Run Report Exerciser form, you can modify the summary or detail
and Primary File Query definitions.
a The Print Report After Spooling field defaults to true (yes). Change this to
false (no).
b The Background field defaults to true (yes). Change this to false (no).
If you leave the default set to true, the report will run at a set time in the
background processor.
If you change the default setting to false, Report Writer schedules the
report to pass to the printer and print immediately after generating it.
c Click View Spooled Reports. The spoolheader form opens, which enables
you to view the report output online.
Background Processing
When you schedule a report to run in the background, a simulated user session
within the HP Service Manager system generates the report.
The default background processor (report), starts when HP Service Manager starts
and processes all reports. Report Writer adds information about the report to the
schedule table. The report background processor scans the schedule table every 60
seconds (the default scan interval), for any records whose scheduled time has
elapsed and whose class is defined as report. When it finds a record, the
background processor performs all functions necessary to generate the report to the
spool and spoolheader tables. You can schedule reports to run in the future and
specify a repeat interval. For example, you can schedule a report to run once every
few hours, once a day, or once a week.
2 From the Report Maintenance form, ensure that all the information about the
report is correct. To modify any information, click Edit and make the necessary
changes.
3 When you are finished editing the report, click Run to schedule the report for
background processing.
20 | Running Reports
Report Writer Guide
Select (check) Print to print the report when it finishes spooling. Report Writer
prints the report immediately after generating it.
Leave the field blank (unchecked) to only spool the report. The report remains
in the spool table until you delete it schedule it to print.
– OR –
Leave the field blank (unchecked) to print the report in the user's session. To
learn more about running reports in a user’s session, see Running reports in
foreground on page 19.
7 Type the number of lines per page in the Lines Per Page field that you would
like printed on the report. Otherwise, it will default to the original settings in
the report form.
8 Click Run.
The Schedule a Report (report.prompt.sch1) form opens.
10 Click Schedule.
HP Service Manager returns you to the Report Maintenance (report) form and
displays the following message in the status bar: “Approx. time of exec:
(00: 00: 00) for report: (name of report).”
A record in the schedule table now contains all the pertinent run information.
Background Processing | 21
HP Service Manager
12 Open Option > Maintenance Schedule to view the schedule record. For more
information, see Viewing and editing report schedules on page 22.
13 Open Options > View Spooled Reports to view the report. For more
information, see How do I view a report online? on page 24.
The available options may vary depending on the preferences you have selected,
the record you select, and your permissions
When the background processor begins processing the report, it changes the Class
field from report to blank, and updates the Status field to application running.
While both of these conditions exist, the background processor is actively
processing the report.
22 | Running Reports
Report Writer Guide
If you specify a repeat interval in the schedule record, Report Writer uses the same
schedule record to re-define when the report should be spooled again. Report
Exerciser (the application called by the background processor) takes the original
expiration time and adds the repeat interval to it, updates the status to re -
scheduled, and changes the application name back to its original setting.
Viewing reports
When Report Writer generates a report, it adds the report to the spoolheader and
spool tables to be printed or available for online viewing. The spoolheader and
spool tables link to each other. You cannot modify the contents of the report, but
you can adjust the spoolheader table information, if necessary.
After sending a report to the spoolheader and spool tables, Report Writer passes it
to the operating system based on parameters you define when scheduling the report
to run.
The spoolheader table defines the name of the report, the time the report started and
ended spooling, and the operator who scheduled the report to be processed.
The spool table contains the actual report (each page being a separate record within
the spool table). You can view the generated reports online.
The fields in the spoolheader and spool forms are described in the HP Service
Manager field help.
To view the help for a field, put your cursor in the field and press Ctrl+H or
select Help > Help on Field.
Viewing reports | 23
HP Service Manager
Place your cursor in the field on which you would like to base your search, and
click Find.
A record list opens, and a record frame opens to display the item details.
24 | Running Reports
Report Writer Guide
3
Using Stacked Queries
Report Writer enables you to define selection, totaling, and report form criteria
Using stacked queries for sorting
Report Writer bases report generation on the records retrieved from the primary file
by the definition of the primary query or the definition of the stacked queries.
Different rules apply to each of these situations and each has advantages and
disadvantages over the other.
The primary query is fully keyed and no sort fields are defined.
category
status
open.time
assignment
category
open.time
assignment
category
This query is partially keyed. The sort fields force HP Service Manager to use the
second key to retrieve the records. Report Writer must expand each record the
query retrieves (in this case all records appearing in the key list for the second key)
to determine if the data record meets the search requirement.
The sorting requirements for a report are not defined as a key in the Primary
File's dbdict.
The primary query does not reference the same key as the sort fields.
The reporting requirements are such that one fully keyed query cannot be
defined.
Important: Do not specify other field types. Other types of fields can cause Report
Writer to abort the sort.
Report Writer runs each stacked query against the primary file and stores all
records in the sort work table, temporarily.
Report Writer runs the primary query against the sort work table, and therefore,
under normal circumstances, is defined as true.
The work table is a logical file defined with the following naming standard:
workxxxmmddyyhhmmss
where work is a constant, xxx is the name of the primary file and mmddyyhhmmss
is the date and time that the work table was created.
The work table is created in physical file 3. Exercise caution when using
stacked queries. Stacked quires causes all records from any table to be read and
placed in the sort work table.
The work table, scheduled for deletion 2 hours after its creation, has a class of
report and an operator name of sortsubr. Periodically review the dbdict file to
ensure that all work tables have in fact been deleted. Be sure to only delete
those files that completely follow the naming standards of the sort work tables.
The sort routine copies all unique keys from the primary file to the sort work
table and adds the sort fields as nulls&duplicates keys. All no nulls and no
duplicates keys that appear in the keylist before the first unique key are copied
to the sort work table. If no unique, no nulls or no duplicates keys exist, the first
key in the keylist is copied to the sort work table.
If the same record is retrieved using different queries and at least one unique
key is defined for the sort work table, the duplicate record is not added to the
sort work table.
All error messages issued from the sort routine are logged in the msglog file.
A message stating how many records were added to the sort work table based
on the execution of each stacked query is issued to the msglog file.
1 List all open Incident tickets for the categories of lines, modems, and operator.
3 The primary file is probsummary and the following keys are defined.
number
**********************
flag
category
subcategory
company
*******************
logical.name
*******************
Field Value
Primary File probsummary
Primary Query true
Stacked Queries category="lines" and status=~"closed"
category="modems" and status=~"closed"
category="operator" and status=~"closed"
Note: Each of these queries is fully keyed. For optimal performance, define the
queries so that HP Service Manager can meet all or most of the query
requirements from a key list rather than having to expand records retrieved
from a particular key.
category
assignment
status
open.time
Note: These sort fields are not defined as keys in the primary file, but they will be
defined as keys in the temporary file.
If the report ran at 15: 00 hours on 02/07/06, the name of the sort work table would
be workprobsummary0207061500.
4
Using Report Forms
When you create a report, Report Writer uses several forms to generate it.
| 31
HP Service Manager
For this example, open problem.category. This is the report created in How do I
create a new report? on page 15.)
2 Click Edit to open then editing screen and add any necessary information. The
Report Maintenance form opens.
3 Edit the fields, based on the following table and the information in The Report
Maintenance form on page 12.
Field Description
Detail problsummary.category.detail
Sort Sequence assignment
This example report does not use stacked queries, therefore the sort
sequence field must be a key in the primary filename (probsummary)
dbdict.
Width (80/132) 80
4 When filling in a detail form for a report, you must define the Input fields. You
may also define Caption fields.
If the Name field is blank, Forms Designer opens a prompt where you can
name your report.
6 Fill in the detail form, following normal Forms Designer procedures. For more
information, refer to the HP Service Manager Help.
7 Click Add.
Note: Edit the field names to reflect their dbdict field names. To ensure that the
input field names are correct, you can associate the form with the primary file
of the report. As you define each input field, check the field name to verify
that the field does exist in the primary file.
11 To run this report, follow the instruction in Running Reports on page 19.
For this example, open problem.category.report. This is the report created in How
do I create a new report? on page 15. The Report form opens.
4 Open Options > Set Query to access the query form and begin the process of
setting queries for the report. The Report Query Maintenance form opens. For
a description of this form, see The Report Query Maintenance form on
page 36.
If report queries already exist for this report, a record list of those queries
opens. From this list, you can select a query for maintenance.
If there no report queries exist for this report, HP Service Manager prompts
you to add a query.
5 Select a record from the list and click Edit to make changes.
a Type the name of the query in the Name field and the query into the Query
field.
b Type the query you want to use as the primary query in the Query field.
status#"alert" or status#"DEADLINE"
The associated form opens. For this example, the probsummary form opens.
Report Writer displays the form and the search arguments you specify in the
Query field of the Report Query Maintenance form. For more information, see
Field descriptions for the probsummary form on page 37.
8 Type data that will satisfy your search. The more fields you fill in, the narrower
your search will be.
9 Click Query Window to open the query form. You can view and edit the SQL
translation of this query in this form.
– OR –
Press Enter to translate the query into SQL. HP Service Manager again
displays the form with that SQL expression in the Query field.
Note: This routine does not automatically insert the flag=true portion of queries,
which are normally associated with queries used against Incident
Management and Change Management.
For this example, the desired query, which will select all records from the
probsummary file that have a category value of network, is displayed. Therefore,
press Enter.
HP Service Manager displays the translated SQL expression in the Query field.
network
11 Optionally, you can modify the SQL expression shown in the Query field.
For this example, add the following to the expression in the Query field.
and flag=true
12 Click Add to add a new query record, or click Update to update an existing
record.
While in the Run Report Exerciser form, the query you defined in the
previous steps is now in the Primary File Query field. However, the
original Primary Query defined in the report record itself is not affected.
The fields in this form are described in the HP Service Manager field help. To view
the help for a field, put your cursor in the field and press Ctrl+H or select
Help > Help on Field.
The available options may vary depending on the preferences you have selected,
the record you select, and your permissions
Build Displays the form defined in the Query Form. If you do not
specify a form, HP Service Manager displays the form with
the same name as the primary file name of the report (if
any.)
Clear Clears all displayed fields.
Field Description
Header Information structure
Incident No Use this field to query for a specified Incident number. Leave this
field blank to return records with any incident number.
Status Use this field to query for a status. Leave this field blank to return
records with any status.
Category Use this field to query for incidents classified by this the category.
Leave this field blank to return records with any category.
Assigned To Use this field to query for incidents assigned to this person. Leave
this field blank to return records assigned to any person.
Priority Use this field to query for incidents with the Priority (1 through 4).
Leave this field blank to return records with any priority.
Change No. Use this field to query for incidents with this the unique change
record number. Leave this field blank to return records with any
change number.
Page Use this field to query for a specific page number of the printed
report. Leave this field blank to return all pages.
Field Description
Reassign Count Use this field to query for incidents tickets that have been
reassigned the specified number of times. Leave this field blank to
return records that have been reassigned any number of times.
Opened Use this field to query for incidents opened on this date. Leave this
field blank to return records opened on any date.
Alert Use this field to query for the alert status that was generated, if an
alert has been generated for this record. Leave this field blank to
return records with any alert status.
Updated Use this field to query for the date the record was last updated.
Leave this field blank to return records updated on any date.
Closed Use this field to query for the date the record was closed. Leave this
field blank to return records closed any date
Logical Name Use this field to query for the logical file name of the device
associated with the record. Leave this field blank to return records
with any logical name.
Location Use this field to query for a particular company location. Leave this
field blank to return records with any location.
Contact Name Use this field to query for a particular contact name. Leave this
field blank to return records with any contact name.
Service Contact Use this field to query for a particular service contact. Leave this
field blank to return records with any service contact.
For example, if the report requires a date and time range, you can use an initial form
to enable the user to enter this range rather than entering a complete SQL query in
the Primary Query field.
From the main menu or system navigator, open Tailoring > Forms Designer.
3 Create the form, using the usual Forms Designer procedures. For more
information, refer to the HP Service Manager Help.
Note: The Input field names for the fields displayed when creating your new form
in Forms Designer are $start and $end.
4 To include information from the initial form on the report, change the Primary
Query statement to the following.
5 Click Run to run the report. For more information, see Running Reports on
page 19.
Note: You cannot run reports that use the initial form option in the background.
Therefore, the Run Report in Background field is defaulted to f (false).
3 Open Options > Totals to access the Report Totals (report.totals) form. This
form is described in The Report Totals form on page 40.
This form utilizes a lot of screen real estate. You can use the scroll bars to move
to the left and to the right or up and down.
The fields in this form are described in the HP Service Manager field help. To view
the help for a field, put your cursor in the field and press Ctrl+H or select
Help > Help on Field.
The available options may vary depending on the preferences you have selected,
the record you select, and your permissions
Forms Designer Opens Forms Designer, enabling you to edit the form of a
report. For more information, see the HP Service Manager
Help.
This report generates subtotals from the primary file (problem), showing the total
number of records for each Assignment Group.
1 Access the totals section of the report you want to create a totals form for. For
more information, see How do I access the Totals section of a report? on
page 40.
For this example access the totals section of the problem.category report.
2 Type the name of the form want to use to print the subtotal in the Form Name
field of the Totals structure.
If the form does not exist, open Tailoring > Forms Designer and create the
form using normal Forms Designer procedures. For more information, refer to
the HP Service Manager Help.
3 Create each field, using the input properties described in this table.
Field Description
report.count Contains the total number of detail records processed by the report
and is normally printed on a grand totals form, but may be printed on
any totals form to show a running total.
report.subcount Contains the total number of records processed for each calculation of
each subtotal. If it is necessary to reference a particular array element
on a subtotals form, the correct field name would be report.subcount,x
where x is an array element number relative to the position of a
calculation within the totals definition. This field is normally used in
conjunction with the report.sumflds field for summary totals.
report.sumflds Contains the value of each field that caused a control break. This field
is normally used in conjunction with report.subcount for summary
totals.
report.subfld Contains the value of the field entered in Reset Field/Variable Name
at the time a control/condition break is detected.
$rw.dummy A variable defined by Report Writer that contains NULL characters.
$rw.months Contains full month names. January is the first element with
December being the twelfth element.
$rw.mon Contains abbreviated (three-character) month names. Jan is the first
array element with Dec being the twelfth element.
$rpt.date A variable defined by Report Writer that contains the date and time
when the report was run.
$page A variable defined by Report Writer that contains the page of the
output of the report.
4 Click OK to save your new form before exiting the Forms Designer to save the
changes you made to the form.
Note: Any time you scroll left or right while in this form, place the cursor in the
home position before scrolling. This ensures that the labels and input fields
remain properly aligned within the structured array.
6 To define the field by which you will be subtotaling, type its name in the
Reset/Field Variable Name field.
7 Scroll to the left again to enter parameters in the third section of this form.
This forces the subtotals to print even if only one detail record is printed.
Note: If you would like to erase all values in the Report Totals form, click Clear
Fields.
A confirmation prompt will display, allowing you to either click Clear Fields
to continue clearing the fields or Abort to cancel deleting the totals
information.
10 To run this report, follow the instruction in Running Reports on page 19.
Summary totals display the same statistics printed in each subtotal, but in a
summarized form. Changing the Summary/Detail field on the Report
Maintenance form causes only the totals portions (subtotals, summary totals,
and grand totals) of the report to print. The detail form does not print.
Grand totals show the total number of detail records selected during report
generation.
1 Create the report. For this example, use the following parameters.
Field Value
Report Name operator.count
Report Title Monthly Inventory
Auto/Manual Auto
Summary/Detail Detail
Primary File operator
Header Format Name operator.count.header
Detail Format Name operator.count.detail
Primary Query true
Sequence of Report model
2 Service Manager checks for a form the matches the name you specified in the
Detail Format Name fields.
model
logical.name
serial.no
location
5 When you are finished adding the report, click Edit Rpt to access the Edit
functions.
7 Type the name of the form to use to print the subtotal in the Subtotals Format
Name field.
Note: You can create the subtotals form through normal Forms Designer
procedures either before entering the Totals Parameters or during the Totals
Parameters definition process.
8 Position the cursor on the Totals Format Name field and open Options > Forms
Designer.
9 Edit the fields to update the form. For the example use the following values.
Caption Input
Subtotals for: report.subfield
No. of recs: report.subcount,1
$rw.dummy
11 To force a page break after each subtotals form prints, type true in the New Page
field.
12 To access the second portion of the Report Totals form, press Home to move
the cursor from the array, and scroll to the left until you see the label
Reset/Field Variable Name.
13 To define the field by which you will be subtotaling, type its name in the
Reset/Field Variable Name field. This causes the subtotals form
(operator.count.subtot) to print every time the value of the Model field
changes.
14 Scroll to the left again to enter parameters in the third section of this form
15 To run this report, follow the instruction in Running Reports on page 19.
5
Using Format Control in
Reports
Report Writer uses several forms. Each of these forms can have Format Control
records for Report Writer to run when executing your report.
This table describes format control on the report forms and how to use it.
2 Type the name of the form you want to see in the Form field of the Forms
Designer dialog box.
– OR –
Click Search to find the form.
Important: Ensure that this Format Control record has the same name as the detail
form.
1 Create the report. For this example, use the following parameters.
Field Value
Report Name problem.calculations.demo
Report Title Demo of Using Totals Calculations
Auto/Manual auto
Summary/Detail detail
Primary File probsummary
Header Format Name problem.calculations.demo.header
Detail Format Name problem.calculations.demo.detail
Stacked Query flag=true and status~="closed"
Sequence of Report assignment
2 Create the detail form using following input fields. For more information, refer
to the HP Service Manager Help.
number
category
sassignment
status
open.time
$demo.elapsed
4 When you are finished adding the report, click Edit Rpt to access the edit
functions. The report opens.
6 Type the name of the form being used to print the subtotal in the Format Name
field.
10 Click Tailoring > Forms Designer. For more information, refer to the HP
Service Manager Help.
Caption Input
Summary totals For: report.subfld
Average Elapsed Time: $demo.elapsed.average
Total Elapsed Time: $demo.elapsed.sum
11 To calculate the average and sum of the variable $demo.elapsed for each grouping
of problem records by category, type the values shown for the Field/Variable
Names to Total and Calc fields.
12 Scroll left to view the second portion of the Report Totals form.
13 Specify values in the Variable Names on Form array to identify where to print
the result of the calculation within the subtotals form.
14 Type category in the Reset Field/Variable Name field to calculate the totals
separately for each category grouping.
15 When you are finished entering the appropriate data, click End to return to the
Report Maintenance form.
16 To evaluate the value to be used for the $demo.elapsed variable, you must attach
Format Control to the detail form.
a When you are finished with your design changes, open Options > Format
Control to create a new Format Control record.
c Ensure the name of your Format Control record is the same name as your
subheader form.
Field Value
Display true
Calculation if (status in $file#"closed") then ($demo.elapsed=close.time in $file - open.time in
$file) else (#$demo.elapsed=tod() - open.time in $file)
Put all expressions on one expression line, separated by semicolons. Never
place a semicolon at the end of the final expression. This causes HP Service
Manager to expect another expression.
h When you are finished, click OK. Continue to click OK until you return to
the Report Maintenance form.
17 To run this report, follow the instruction in Running Reports on page 19.
The subheader form contains the fields from the primary file, defined in the
report.
The detail form contains fields from the secondary file, defined in the
Secondary File Queries section of the Format Control record of the subheader
form.
A common field value connects the primary and secondary files.
In this example, we match the value in the Location field from the location table
(primary file) with the value in the location field from the operator table
(secondary file). Each time the report selects a record based on the Primary Query
from the primary file (location), Report Writer uses Format Control to find the
matching records in the secondary file (operator) using the Location field.
1 Create a new report in Report Writer, using the following values. For more
information, see How do I create a new report? on page 15.
Field Value
Name location.summary (or any unique name)
Title Any title
Auto or Manual Auto
Summary or Detail Detail
Primary File location
Header Format location.summary.header (default)
Subhdr Format location.summary.subhdr
Detail form location.summary.detail (default)
Primary Query true
Sort Sequence location
Since stacked queries are not used, location must be a key in
the primary file's dbdict before you can use it as a sort field.
a Click Tailoring > Forms Designer and create a form in with the following
input fields. For more information, refer to the HP Service Manager Help.
Name
Location
Address
City
State
Zip
Primary Contact
c When you are finished working within the Forms Designer utility, click
OK.
a Click Tailoring > Forms Designer. Create the form using the following
values. For more information, refer to the HP Service Manager Help.
Caption Input
Location: location
Location Name: location.name
Address: address
window=1
City: city
State: state
Zip: zip
Primary Contact: primary.contact
b When you are finished working within the Forms Designer utility, click
OK.
a Click Tailoring > Format Control to create a new Format Control record.
For more information, refer to the HP Service Manager Help.
c Ensure the name of your Format Control record is the same name as your
subheader form.
5 Add queries.
b Click Yes.
Field Value
Display true
Filename operator
This identifies the operator table as the secondary file for this
report. The location table and operator table are connected when
the values in their Location fields match.
Query location=location in $file
Req'd false
Query This signifies that the match is not required for the subheader form
to print.
e Click OK twice to exit the forms and return to the Report Maintenance
form.
a From the Report Maintenance form, put your cursor in the Detail field of
the Forms structure of the Report Maintenance form (on the
location.summary.detail value) and open Options > Forms Designer.
7 To run this report, follow the instruction in Running Reports on page 19.
The report consists of a header and two subtotals forms. It is a summary report, but
it does not use the Summary field (true/false) on the Totals screen. There is a
Format Control record associated with both the header and detail forms. they
contain initialization and calculation expressions for processing record counts.
Field Value
Name problem.severity.summ (or any unique name)
Title A user - defined title
Auto or Manual Auto
Summary or Detail Summary
Primary File probsummary
Field Value
Header Format problem.severity.summ.header (default)
Detail format problem.severity.summ.detail (default)
Primary Query flag=true
Unix users can also use status~="closed".
Sort Sequence severity
To sort and break on the Severity field for a Summary report,
the field must exist as a key in the probsummary dbdict, or the
primary query must be defined as a stacked query.
a When you have all the field values entered, place the cursor in the Header
field (problem.severity.summ.header value) and open Options > Forms
Designer.
b In order to sort and break on the Severity field for a Summary report, you
must set up the same field as a key in the probsummary dbdict, or define
the primary query as a stacked query.
c Click OK to add the new form and return to the Report Maintenance form.
Since this report is a Summary report, Report Writer does not print a detail
form when it generates the report. However, because a Format Control record
is required for calculations to occur on each detail record, we must create a
detail form to attach to the Format Control record.
b Position the cursor on the first Subtotals Format Name field and open
Options > Forms Designer.
d A prompt asks if you want to use the Forms Designer wizard. Click No.
c Access the second portion of the Report Totals form and scroll to the right
until you see the Reset Field/Variable Name field.
d Type severity.
f Click OK.
a Position the cursor on the second Format Name field and type
problem.severity.summ.tot.
c Follow normal Forms Designer procedures to create a new form with the
following input fields. For more information, refer to the HP Service
Manager Help.
open.tot $upd.tot
$alrt1.tot $alrt2.tot $alrt3.tot
report.count
b Fill in the fields in the Report Totals form to add the following values.
c Access the second portion of the Report Totals form and scroll to the right
until you see the Reset Field/Variable Name field.
d Type severity.
a Position the cursor on the Format Header field and open Options > Forms
Designer.
c The Format Control utility opens, enabling you to add a new Format
Control record.
Note: Ensure that the name of this Format Control record is the same name as your
header form.
Note: These initialization expressions run only once during the report generation.
e When you are finished, click OK. Continue to click OK until you return to
the Report Maintenance form.
a Position the cursor on the Format Detail field and click Tailoring > Forms
Designer.
b Create the necessary fields using the normal Forms Designer procedures.
For more information, refer to the HP Service Manager Help.
c Click OK.
Ensure that the name of this Format Control record is the same name as
your detail form.
Note: These initialization expressions run each time you select a new detail record.
Field Value
Display true
Calculation if status in $file#"open" then $opn=1 ;
if status in $file#"upd" then $upd=1 ;
if (index("1",status in $file)> 0) then $al1=1 ;
if (index("2",status in $file)> 0) then $al2=1 ;
if (index("3",status in $file)> 0) then $al3=1
Put all expressions on one expression line, separated by semicolons.
Never place a semicolon at the end of the final expression. This causes
HP Service Manager to expect another expression.
j When you are finished, click OK. Continue to click OK until you return to
the Report Maintenance form.
10 To run this report, follow the instruction in Running Reports on page 19.
A M
accessing matrix report, format control 56
Forms Designer 38
report totals 40 O
Report Writer 11 option, primary query 25
reports 11 options
copy/rename 13
C primary query 25
control for subheaders, using format 52 stacked queries 27
copying reports 13, 14
P
D primary query option 25
deleting reports 14
Q
F queries 11
format control primary 25
accessing 47–48 stacked 27
matrix report 56 stacked, rules 27
subheaders 52 stacked, using 25, 27
format control for subheaders, using 52 queries, stacked 27
forms query forms, using 33
detail 55 query option, primary 25
initial 38
Forms Designer, accessing 38 R
forms, initial 38 records, viewing report schedule 22
forms, using query 33 report schedule records, viewing 22
report totals, accessing 40
I Report Writer, accessing 11
initial forms 38 reports
accessing report totals 40
copying and renaming 13–14
| 63
HP Service Manager
S
schedule records, viewing report 22
spool table 24
spoolheader table 24
stacked queries 27
using 25, 27
subheaders, using format control for 52
T
table, spool 24
table, spoolheader 24
totals section, accessing 59
U
using format control for subheaders 52
using query forms 33
V
viewing report schedule records 22
64 | Index