SM7.11: How to customize Service Manager headers and footers for printing

  • KM1026593
  • 29-Nov-2010
  • 19-Oct-2018

Summary

We would like to alter the headers and footers that are printed using a HTML "pretty print" with the SM 7.11 web tier.

Question

We would like to alter the headers and footers that are printed using a HTML "pretty print" with the Service Manager (SM) 7.11 web tier.  This is not a display option print.

The following headers and footers displayed when printing an incident ticket.  In this printable version of the form, the following are seen out of box, using Internet Explorer:

Header:  "HP Service Manager-Update Incident Number IM10001"    <Page 1 of X>

Footer: "<URL of Service Manager>/printDetail.do    <Today's Date>"

When using a "HTML Print", the browser and/or operating system determines what is printed in the header and footers.  On any opened IE page (it does not have to be Service Manager), select File --> Print Preview and then click on the Page Setup button (Alt-U key) to see the printer header and footer settings.  When IE is used, the printer header/footer codes are as follows:

&w = the browser title text
&u = the current URL in the browser

Answer

The following two items (in combination) will change the browser title bar text under SM 7.11:

1) The file WEB-INF\classes\com\hp\ov\sm\client\webtier\xslstrings_en.properties:
--> The idsTitle property can be used to change the print header title from "HP Service Manager" to whatever you like.  However, the text "-Update Incident Number IM10001" (for example) will still appear after the title.

In that directory, there are multiple properties files that start with xslstrings, each having a "_<language>.properties" suffix for different languages.
The file named xslstrings.properties is the default, if a chosen language does not match any of the properties files provided.
For my test, I'm using english as the local language, so xslstrings_en.properties is chosen.
This is a standard behavior when working with Java properties files.

2) To change the text  "-Update Incident Number IM10001"  (for example)....this text comes from the display screen in use.  Specifically, the $L.title variable.
To change this text for an incident ticket:
a) Access the display screen apm.edit.problem.  Under the Initializations section, add a new line at the bottom, with the following:
$L.title="Rich Title Test"
b) Save the display screen record.
c) Re-query for the incident you want to print.  The new text will be seen as part of the title: "Rich Title Test".

NOTE: If you want the content to be dynamic based on a field value, do the following in step a, for example:
$L.title=location.full.name in $L.filed

This sets the title value equal to the location field value.

-------------

Then, what is actually chosen in the printed headers and footers is up to the browser's header and footer settings.
Under a Print Preview of any page in IE, select the cog wheel icon at the top.
To change the header and footer to contain the text in the browser title bar, code them both to the same values:

Header: &w
Footer: &w

A similar operation can be done under Firefox, except Firefox has drop-down options of what can be chosen in the header and footer.