Objective of This Example
Our Environment
Important things to Know About Printing Hold Cancelation Notices with Print Templates
Export default Hold Pickup Notices Print Template (_HoldCancel)
Export the template to your PC
1) Highlight the template that you want to export and click Export.
2) Select the location where you wish to export the template
**HINT: You may want to create a directory within C:\Millennium called 'Print Templates' to store all exported templates**
Things to keep in mind
Repeat the above process if you want to export other templates, and then select OK to close the Settings window
Edit the exported default hold pickup notice Print Template (_HoldCancel)
The default template, _HoldCancel, is for email or printing notices on an 8.5" x 11" stock.
**NOTE: Measurements in iReport are in "points" not inches. It may be useful to find a measurement conversion tool online.**
** Here is an example of one: http://www.thecalculatorsite.com/conversions/length/points-to-inches.php**
1) Navigate to the directory where the default template was exported during the export Print Template process and open file With Jasper iReport(.jrxml)
**NOTE: 2 files came with this export. A graphics file that is used in the default template is automatically downloaded**
2) Immediately save the file with a different name. File | Save as
**NOTE: It is beneficial to save these files with some kind of version control naming convention, that way if something goes wrong you can easily go back to a version that worked before a change. **
** For example: HCNv0x0.jrxml - stands for Hold Cancellation Notice version 0.0 **
3) Look at the default Print Template data fields and make a list for the changes to be made.
iReport Preview (**NOTE: you do not see the data fields in preview**)
Changes to "Hold_Cancel.jrxml"
~"Hold Cancellation Notice" shaded area
~Hold Cancellation text
~Date Stamp
~Library Address block
~Patron Address block
~Item Record Number
~Author
~Barcode
~Item Location
~Notice Text Number
~Print Sequence Number
~Heading that emphasizes Hold Cancellation Notice - "Your Library Item(s) Will Be Reshelved!"
~Custom greeting - "Hello <patronFirstName> <patronLastName>
~Title
~Call #
Note: it's a best practice to make one template for email and other for print
Steps to make the changes
1) To resized the template 's page size, height, and margins (email)
a. Select Hold_Cancel within the Report Inspector
b. Right-click on Hold_Cancel and choose Properties to bring up the Hold_Cancel Properties window.
c. Change Page Height:648
d. Change all margins to 10
**NOTE: This was done for email template only**
**NOTE: The default page size, height, and margins used for print**
2) To remove a graphic/static field/text field select it and delete it. The deletion can be done with either the delete key, or right-click then select delete.
a. Delete logo graphic - 'columns.gif'
b. Delete "Hold Cancellation Notice" shaded area - 'staticText-11'
c. Delete "Hold Cancellation Notice" static text field - 'Hold Cancellaton..'
d. Delete Date Stamp - 'new.java.util.D...'
e. Delete Library Address block - 'Library_Addr...'
f. Delete Patron Address block - 'Patron_Addr...'
g. Delete Item Record Number - 'ITEM' and 'Item_ID'
h. Delete Author - 'AUTHOR' and 'Item_Author'
i. Delete Barcode - 'BARCODE' and 'Item_Barcode'
j. Delete Pickup Location - 'LOCATION' and 'Item_Location'
k. Delete Notice Text Number - 'Notice Text' and 'Text_Number'
l. Delete Print Sequence Number - 'Print Sequence' and 'Print_Seque..
The template should now look like the following:
3) To make the "Page Header" and "Page Footer" band height smaller (12points to 8points), select Page Header within the Report Inspector. The find the Page Header-Properties pane.
**NOTE: (Ctrl + Shift + 7) is a shortcut key for the element Properties pane**
a. Locate Band height within the Page Header-Properties pane and set value to 8
b. Repeat the above step, but do the same for Page Footer.
4) To make the "Last Page Footer" band height equal to zero, select Last Page Footer within the Report Inspector. Then find the Last Page Footer-Properties pane.
a. Locate Band height within the Last Page Footer-Properties pane and set value to 0
The template should now look like the following:
5) To add library image logo, Open the Palette
**NOTE: (Ctrl + Shift + 8) is a shortcut key for the Palette pane**
a. Drag the Image object to the top of the Title band section
b. A Select an image file.. window will appear. Select Cancel
Since this is a template for email, the URL for the image must be used. This will create a place holder for the image.
In the following steps we will use that URL path.
c. Select the image and drag it into position (top and left-justified)
d. Need to change Image Expression within Image Properties so that the URL is used
ii. The Image Expression editor will appear.
http://www.uccs.edu/images/libiii/UCCS-KLF.gif
**NOTE: Email template needs to have images stored on accessible web server**
iii. To change the image properties, select the image element under the Title band within the Report Inspector. Then find the image-Properties pane.
**NOTE: (Ctrl + Shift + 7) is a shortcut key for the element Properties pane**
- Change image Width: 300
- Change image Height: 34
**NOTE: To avoid unwanted stretching of the image, make the image properties similar in size**
iv. Need to enable Is Lazy within the image-Properties pane
**NOTE: The "Is Lazy" option only needs to be applied to email template images**
The template should now look like the following:
**NOTE: if the image isn't displaying. Save the template. Close and Reopen**
6) To add a heading that emphasizes Hold Cancellation Notice - "Your Library Item(s) Will Be Returned to Shelf", Open the Palette
**NOTE: (Ctrl + Shift + 8) is a shortcut key for the Palette pane**
a. Drag the Static Text object under the image within the Title band section, and align the object so it's left-justified
b. Double-click on the Static Text field and type in the desired heading, "Your Library Item(s) Will Be Returned to Shelf".
c. Need to change the static text properties, so it stands out.
i. Select the static text element under the Title band within the Report Inspector, then find the Static Text-Properties pane.
**NOTE: (Ctrl + Shift + 7) is a shortcut key for the element Properties pane**
ii. Change Properties Forecolor
iii. Change Text properties | Size to 22
iv. Change Text properties to be bold
d. To resize the static text fields to accommodate the new font size
i. Select the field and sizing handles will appear
ii. Left-click on a handle and drag it out to make it bigger
7) Add the custom greeting to the {Patron_Name_C} text field
a. To add the Custom Greeting java express with conditional statement, left-click on the text field to select it.The right-click on the text field, and select edit expression.
b. Overwrite the existing java expression with the following:
"Hello" + ($F{Patron_Name} != null ? $F{Patron_Name}. indexOf(',')>0 ? $F{Patron_Name}. indexOf(' ')>0 ?" " + $F{Patron_Name}.substring($F{Patron_Name}.indexOf(' ')+1) + " " + $F{Patron_Name}.substring(0,$F{Patron_Name}.indexOf(',')) :" " + $F{Patron_Name}.substring($F{Patron_Name}.indexOf(',')+1) + " " + $F{Patron_Name}.substring(0,$F{Patron_Name}.indexOf(',')) : $F{Patron_Name} : "") + ","
Patron_Name field is in following format "patronLastName, patronFirstName"
This java expression will change it to "Hello patronFirstName patronLastname,"
c. Then select Apply
d. Open the Properties Pane and change font to 14
e. Again resize the text field so it displays properly
8) Move the remaining items in "Title" band and left justified them
9) Resized "Title" band in order to remove extra space between "Title" and "Page Header" bands (265points to 215points)
a. Locate Band height within the Title-Properties Pane and set value to 215
The template should now look like the following:
10) Move the TITLE left-justified next to the left margin
a. Select the TITLE static text field and drag it near the top of Detail1 band and aligned on the left margin
11) Move and change the size of the text field for $F{Item_Title}
a. Select the $F{Item_Title} text field and drag it so its top is aligned with the Title: static text field
b. Make the $F{Item_Title} field large enough to accommodate a two line title
c. Open the $F{Item_Title} properties and change font size to 14
d. Change the $F{Item_Title} properties so that "Stretch with overflow" is enabled
**NOTE: This will accommodate 2 line title and the field is larger so it won't overlap the call# below**
12) Move the CALL # to be left-justified next to the left margin
a. Select the CALL # static text field and drag it under the Title static text field
12) Move the $F{Item_Call_Number}
13) Insert static text field that contains an underline to separate records
a. To add an underline , Open the Palette
**NOTE: (Ctrl + Shift + 8) is a shortcut key for the Palette pane**
b. Drag the Static Text object below the Pickup By static text field and near the bottom of the Detail1 section
c. Double-click on the Static Text field and type in enough underline characters to separate records
14) Resized "Detail1" band in order to remove extra space between "Detail1" and "Page Footer" bands
a. Locate Band height within the Detail1-Properties Pane and set value to 110
The template should now look like the following:
15) This should be the end of modifying the Print Template for email. Save the Print Template file to indicate is it for email.
16) Now some few modification need to be made for the Print Template for print
a. Need to change Image Expression within Image Properties so that the image name is used instead of URL
ii. Remove the URL, but keep the quotes and image file name
**NOTE: The image file must be in the same directory as the template**
iii. Verify the Image Expression is correct and disable Is Lazy within the image-Properties pane
a. Change Page Height: 792
b. Change all margins to 20
c. This should be the end of modifying the Print Template for print. Save the Print Template file to indicate is it for print.
1 template for email and 1 template for print. These templates are basically the same except for margins, and the "Is Lazy" option. This was needed to make both types print correctly.
Customized Hold Pickup Templates (HoldCancelNotice_email, HoldCancelNotice_print )
Import the Customized Print Template Back Into Millennium
Import the customized template into Millennium
1) Admin | Settings | Print Template tab
2) Select Hold Pickup Notice from Output Type drop-down menu
3) Verify that Use Print Templates is checked
4) Select Import
5) A New Print Template Attribute window will appear.
Print templates for circulation notices and receipts are grouped into template families. You can create a custom list of preferred template families, preview and modify template families, and save your template family settings.
6) Navigate to the directory where the custom template was saved.
7) Select email for Delivery Method. Then OK (this is the email template).
8) Select the custom template that was just imported and choose the arrow pointing to Preferred Templates to move it over.
9) Select the custom template again and choose Preview.
A Preview Window will appear. This is a good way to test that Millennium can open the customized template.
10) Load the Print Template to be used for print
a. Highlight the custom template under Preferred Template and choose Edit
b. Select Import
c. Select Browse
d. Navigate to the directory where the custom template was saved.
e. Select printer for Delivery Method. Then OK (this is the print template)
f. The Edit Template Family window will appear. Notice that both email and printer are listed now. Choose Exit
g. Choose Save Settings. Then click on OK
Here are the Millennium Previews of the Print Templates (email and print):
Test the Customized Print Template
The only way to really test this template is to do a live test
a. Clear the Hold Cancellation Notices (don't want to send out the test to patrons)
b. Place some items on hold
c. Cancel those holds
d. Pick the appropriate cancellation message
e. Run the Hold Cancellation notices
f. When prompted, use the custom Print Template
g. Send Hold Cancellation Notices
Sample of the generated email
Sample of the generated print