IUG FORUM

Stay always connected!
  1. John Luke
  2. Sierra/ Millennium/ Encore
  3. Friday, 25 August 2017
  4.  Subscribe via email
I have a library that has two computers both running Win 10 and Sierra. In Admin >> Settings >> Print Templates, I have the user select 'Due Slip' in the left pull down, check 'Use Print template', and then highlight their libraries' new print template that I custom made in Jaspersoft Studio and imported into Sierra.

When the user hits the preview button on No.1 computer, their correct Print Template pops up in a view as it should.

But on their No.2 computer, the user gets a error message when they hit preview..

When a patron checks out using No.1 computer, the new custom due slip prints out fine. No receipt gets printed when using No.2 computer.

Trying to figure out what No.2 computer doesn't like about the Print Template I made. The only difference I can tell is that the computers have different Java update build numbers. Not sure where else to look.

jluke@mail.owls.lib.wi.us
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
I'm not sure this appies, but Check your template for string functions like .contains, .replace, etc. And see if you check the string for != null before you pass it to that function. I'm becomgin abroken record, but I found that (apparently with a change in our Java runtime version) our templates stopped running when we move to Sierra until I corrected them for this.

CHARPER@vts.edu
Comment
There are no comments made yet.
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
Thanks Cindy! It does have a couple .equals() and .substring(,) functions. No checks for !=null before the function calls.

Not sure how to fix the code as the site is an hour away making testing problematic. I really can't get rid of the .equals and the .substring functions either.

jluke@mail.owls.lib.wi.us
Comment
  1. Cindy Harper
  2. 1 year ago
  3. #892
Can you upload your template, and I'll see if I can make it work?

Cindy

CHARPER@vts.edu
There are no comments made yet.
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
Also, Ryan Ewers was the one who first posted this fix. His example is here:
http://innovativeusers.org/index.php/iug-forum/sierra-millennium-encore/10330-sda-java-8,-print-templates,-and-the-replace-method.html


Guest
Ryan Ewers
0
Votes
Hi Sarah, I had a similar issue but with a different method. Any line with ".contains" would make it so they would not print. The fix was to change it so it looks like it does below. Could you copy and paste the problem line to this discussion?

<textFieldExpression class="java.lang.String"><![CDATA[($F{patron_last_name} != null ? ($F{patron_last_name}.length()< 4 ? $F{patron_last_name} : $F{patron_last_name}.substring( 0,4 )) : "";)]]></textFieldExpression>

rewers@auroragov.org

CHARPER@vts.edu
Comment
There are no comments made yet.
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
Here's the template. The graphic is there too.

jluke@mail.owls.lib.wi.us
Attachments (2)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 4
Accepted Answer Pending Moderation
0
Votes
Undo
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>

<textFieldExpression><![CDATA["Items checked out to: " + $F{Patron_Record_ID_C}]]></textFieldExpression>


<textFieldExpression><![CDATA[(!$F{Item_Title}.equals("";) ? "<style isBold='false' size='10'>" + net.sf.jasperreports.engine.util.JRStringUtil.xmlEncode(($F{Item_Title}.length() > 40) ? $F{Item_Title}.substring( 0,40 ) : $F{Item_Title}) + "\n" + "</style>" : "";) +
(!$F{Item_Barcode}.equals("";) ? "Barcode: " + $F{Item_Barcode} + "\n" : "";) +
(!$F{Item_Due_Date}.equals("";) ? "<style isBold='TRUE' size='10'>DUE DATE: " + $F{Item_Due_Date}.substring(0,8) + "</style>" : "";)]]></textFieldExpression>


<textFieldExpression><![CDATA[$F{Patron_Checked_Out_Number_C}]]></textFieldExpression>

<textFieldExpression><![CDATA[$F{Total_Patron_Fines_C}]]></textFieldExpression>


Note: Everyplace that may have a smiley face inserted should have a closing parenthesis ) instead.

jluke@mail.owls.lib.wi.us
Comment
There are no comments made yet.
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 5
  • Page :
  • 1
  • 2
  • 3


There are no replies made for this post yet.
Be one of the first to reply to this post!