Login to LibApps.

Print Templates 102: Customizing Templates

Customizing Templates

Here's the basic sequence...

1)  Think about what functionality you need from the template.
2)  Decide if you want to use a Default template, or Customize your own.
3)  If customizing, c
onsult the Template Data Library for your field options.
4)  Sketch a design of your template.

5)  Export the default template from your system (Millennium or Sierra).
6) 
Customize using your editor (iReport or Jaspersoft Studio)
7)  Import your new template back into the system.
8)  Assign the template to those who need to use it.

Tips for Customizing Print Templates

  • Always start with the default templates
  • The default templates already been developed with defined page size and bands.Try not to manipulate them much.  For example, if you take away space from one band, you may have to add it to another.Try to work with what is given to you rather than developing something new. Hint: By default, all circulation notices print on a full page (U.S. Letter, 8.5" x 11" / 21.59cm x 27.94cm)
  • Make incremental changes, save, and test often!

Print Template Troubleshooting
CSDirect has a page listing the common problems (Log-in Required):

http://csdirect.iii.com/documentation/trouble_printtemplates.shtml#pt2

The first step in creating a custom template involves exporting the default template from your system. Remember that print templates have to be enabled and the user has the appropriate permissions to begin the process of customizing a default template.

In the example found below you'll see screen shots from Millennium. The steps involved in exporting default templates in Sierra are exactly the same.

1) Start by logging into Millennium. Then choose the Settings option from under the Admin menu.

 

2) Select the Print Templates tab, and select the Output Type (template type) you wish to use from the drop-down menu.

 

3) Check the box for Use Print Templates. Next, click on the default template (default templates start with the underscore), then click on Export.

 

4) A Choose a directory (folder) window will appear. Browse to find the desired directory where you want to save the default template. Then click on the Choose a directory button.

***HINT: Make a folder within the Millennium directory called "Print Templates". Then make subdirectories that have names pertaining to the type of templates. For example: "C:\Millennium\Print Templates\HoldPickup"***

Things to keep in mind...

  • Format of the files is jrxml (Jasper Report XML)
  • If you have files in the directory you are exporting to, you can't see them in the Choose a directory window
  • If you have a file with the same name as the one you are exporting, it will be overwritten without warning!
  • Do not enter a file name.  The system will automatically name these exports
  • Graphic files used in templates are stored separately, and are exported automatically

Repeat the above process if you want to export other templates, and then select OK  to close the Settings window.

The next step is to open the default template and begin to customize it.

Back to Top

Innovative provides a Template Data Library of fields for each type of template. When customizing Print Templates you'll want to consult these libraries to determine what fields you have available to work with. Below you will find information about the Template Data Libraries for Millennium and Sierra.

Template Data Libraries in Millennium

Please note that this list is not comprehensive, rather it highlights some of the more popular print templates in use. To see the full list of template data libraries consult the Millennium manual page #107515.

 

Module Template Data Library Manual Page
Circulation Courtesy Notices 107884
Hold Pickup Notices 107888
Hold Cancelation Notices 107886
Overdue Notices 107894
Recall Notices 107895
Item Paging Slips 107891
Item Paging Lists 107890
Title Paging Lists 107898
Transit Slips 107613
Hold Shelf Slips 107612
INN-Reach Paging Slips 107910
INN-Reach Transit SLips 107726
INN-Reach Hold Shelf Slips 107946
Pick-up Anywhere Paging SLips 107945
Serials Serials Routing SLips 107535
Cataloging Monograph Spine Labels 107534
Express Lane Due Slips 108197
Ecommerce Receipts 108196
Program Registration Attendance Lists 108141

Template Data Libraries in Sierra

A list of the template data libraries available in Sierra can be found in the Sierra Guide under Sierra Reference > Print Template Data Libraries.

Back to Top

Getting Started with Images

Images that are to be printed need to be treated differently from images that will be emailed, e.g. an image included in a circulation notice that will be mailed to a patron will be set-up differently than an image included in a circulation notice that will be emailed to patrons.
 

Images in Templates to Be Printed
To use images in print templates that are to be printed, keep in mind the following:

  • All image files used in the template must reside in the same local workstation directory as the template created with the template editing application (the jrxml file).
  • Enter only the image's filename in the template. Do not include the full path (e.g., enter "StateSeal.jpg" rather than "C:\iReport\work\StateSeal.jpg").
  • You must import the image files along with the template.

 

Images in Templates for Circulation Notices and Receipts to Be Emailed
To use images in print templates for circulation notices, due slips, and Ecommerce receipts that are to be emailed, keep in mind the following:

  • Place image files on a Web server accessible to the public.
  • Include the image's full path and filename in the template. For example, you must enter "http://north.lib.edu/pt/StateSeal.jpg", not just "StateSeal.jpg". For more information, see Customizing Print Templates on CSDirect (Log-in Required).
  • You do not need to import image files for email templates.

Back to Top

Adding Images

Images can be added to any template that you work with.  The example found below was created using Jaspersoft Studio. An explanation of how to add images to a template using iReport can be found here: http://libguides.uccs.edu/c.php?g=464620&p=3176721
 

In this example a new image will be in the Title section of a routing slip.

 

1) Select the Image element from the Palette, and then drag the field to the desired template section (here, the title band).


 

2) A window will open. Select the Custom expression option and then enter the file name in field making sure to enclose the file name in "double quotation marks." Click on Ok when done.


The image should now be listed under the Title section and it should also be visible on the design view of the template.


3) Click on the image, or select the image file name under the Title section to get the resizing handles to appear around the image. Resize as needed to fit into the space allotted.


 

The other elements within the Title section may have to be moved/resized for the template to display just right.  The template design can be checked by clicking on the "Preview" button.


 

Adding images is not hard, but it may involve moving or resizing existing elements for the template to display correctly.
Because this template will be printed you need to be sure you follow the image rules for printed templates:

  • All image files used in the template must reside in the same local workstation directory as the template created with the template editing application (the jrxml file).
  • Enter only the image's filename in the template. Do not include the full path (e.g., enter "StateSeal.jpg" rather than "C:\iReport\work\StateSeal.jpg").
  • You must import the image files along with the template.

 Back to Top

Adding an active URL can be an extra-useful feature on templates that are being emailed to users. The example found below shows how to add a URL to a template using Jaspersoft Studio. Instructors on how to add a URL to a template using iReport can be found here: http://libguides.uccs.edu/c.php?g=464620&p=3199495.

Adding a URL

1) In the Palate, click on Text Field element and drag and drop the field to its place on the template.

 

2) In the Properties panel, click on the Hyperlink tab. Here's what you'll see...

3) From the drop-down menus select Link Target of Blank and a Link Type of Reference.

 

4) You can type the URL into the Hyperlink Reference Expression box, or you can click on the Expression Editor box located to the right of the field and enter the URL there. Be sure to put your URL in "double quotation marks."

 

5) Double-click on the Text Field and type the message you wish to have displayed to the user being sure to place it in double quotation marks.

 

You'll now see this text integrated into your template.

 

6) Unfortunately this link does not look like a link! If you wish you can change the font color to blue and underline the text so that users can identify that this is a link. You may also want to change the font size. See our Print Templates 101 LibGuide for information on changing font color, size, and adding underline to text.

 

If you Preview the message you can mouse over the field to ensure that the URL looks correct.

Back to Top

Adding Barcodes

In this example, we will add the item barcode to an already customized Print Template. This example was created using Jaspersoft Studio. An explanation of how to add barcodes to a template using iReport can be found here: http://libguides.uccs.edu/c.php?g=464620&p=3176723

1) To add a barcode first open the Palette. Select the Barcode element from the Palette and drag it to the desired area within the Print Template.

2) As soon as you "drop" the field the Barcode Wizard window will open. Choose the correct barcode format for your institution and then click on Finish.

 

4) The barcode element is now in the print template. Select it if it's not already highlighted.

 

5) Resize the barcode and align to display properly.

 

6) Now the Code Expression needs to be changed to a Print Template Data Library element. Make sure the barcode element is still selected, bring-up the Properties panel, and click on the Field atb. Click on the Expression Editor button found to the left Expression box.

7) Change the default Barcode Code Expression to the correct data field. This involves:

  • Deleting the string "1234"
  • Finding Item_Barcode within the Fields list
  • Double clicking on Item_Barcode to insert that field into the editor.
  • Selecting OK to close the Barcode Code Expression window

 

 

This is what the print template should look like after inserting/manipulating the barcode element.

Back to Top

Java Expressions

There are various reasons to use Java expressions in a template. These expressions can be inserted into template  text fields to customize template output. Remember a field represent the data library available from Millennium. For the more advanced user that are familiar with Java, note that these  elements from the data library are of field class type 'java.lang.String'.

Documentation on the Java string library can be found here:
http://docs.oracle.com/javase/6/docs/api/java/lang/String.html

 

Important: Do not remove any Java expressions embedded in barcode-related data elements. The client might become unstable if you preview or print a template that does not contain the required Java expressions.

 Back to Top

Example Using Expressions

The example found below was created using Jaspersoft Studio. Information on how to integrate Java Script into a template using iReport can be found here: http://libguides.uccs.edu/c.php?g=464620&p=3176722

 

In this example, the template needed to provide a message targeted for certain ptypes. This message is only shown for ptype(s) "Faculty/Staff" or "Lib faculty". The first step was to add a Text Field element to the template.

This shows the added "Text Field" element within the template:

 
To start customizing the Text Field element, click on the element. The text field will be highlighted in the Outline View panel to indicate it is active/selected. Expand out Properties panel and click on the Field tab.

 

Click on the button found next to the Expression box to open the Expression Editor.

 

Here's what the Expression Editor looks like...

 

The box at the top is where the expression code needs to be inputted. The code for our example looks like:

// Print office delivery message only to ptypes for staff and faculty
($F{Patron_Type_C}.equals( "Faculty/Staff" ))
||
($F{Patron_Type_C}.equals( "Lib faculty and staff" ))
? "For Office Delivery contact the Circulation Desk at 255-3296."
: ""

 

***NOTE: Be careful when copying and pasting. You may want to paste the expression first into a simple text editor. Then do some cleanup  and paste it into the template*** 

 

This code will check for the 2 different ptypes ("Faculty/Staff" and "Lib faculty and staff"). If the ptype is either of these, it will print out the message ("For Office Delivery contact the Circulation Desk at 255-3296."). If the ptype is not one of these it will print nothing.

     

This is the Text Field Expression after being inputted into the Expression Editor:

      

Syntax for Java expressions is very important. You must be familiar with how Java expressions are formed.
If the Text Field Expression has a syntax error, it will be displayed within the editor.

       

This is the Text Field Expression Editor with an error being displayed:

       

This is the Text Field Expression Editor with no errors being detected:


        Back to Top

Preview and Report State View
After making changes to a template it is advised to use the Preview tab.  

Jasperstudio Editor Preview Tab

 

By selecting this tab the template is automatically compiled and checked for any errors. The more advanced the template becomes previewing it often can help troubleshoot any errors with the template. These errors will show in the Report State View.

  Back to Top

After you are done customizing your template you need to import it back into your system. In the example found below you'll see screen shots from Sierra. The steps involved in importing default templates in Millennium are exactly the same.

1) Start by logging into Sierra. The select Settings from the Admin menu.

 

2) Select the Print Templates tab, and select the Output Type (template type) you wish to import from the drop-down menu.

 

3) Ensure that the box for Use Print Templates is checked, then click on Import.

 

4) A New Print Template Attributes window will appear. Fill in the Template family name and the Description.

***TIP: it is beneficial to use an incremental naming scheme with the version of the template which you are importing (e.g. Hold_Pickup_v1).***

Once you have named your files click on Browse.

 

 

5) Navigate to the directory where the template was saved. Select the template (.jrxml), and then choose Open.

 

6) The template will be imported into the Templates files field of the New Print Template Attributes window. Click on OK.

 

7) The customized template is now imported into your ILS and should be listed within the Other Templates pane.  You can now highlight the new template and choose the Preview button to see a quick representation.

 

Your ILS will now open a Viewing window to preview the template.

 

 

***Hint:  At this point it is a good idea to test the template.  Ways to test the template may differ depending on the type of template. Our Hold Pickup notices are emailed. For this kind of testing, we run the job for "Hold Pickup Only" notices type with the current template. Once the job is cleared, a book is placed on hold. Then we immediately run the job again. This time we will select the new template.  Hopefully, our test hold is the only one to send. This is a cumbersome method, but we haven't found a good way to test emailed templates. After the test is done and the template is confirmed to be working correctly, we continue with modifying the custom template.***

 

8) Use the arrows to move your template over to the Preferred Templates Field.

 

 

9) Click on Save Settings, then on OK.

 

Back to Top

Loading