FacebookTwitterLinkedIn
Login / Register

Login / Register

IUG FORUM

Stay always connected!
  1. John Luke
  2. Sierra/ Millennium/ Encore
  3. Friday, August 25 2017, 02:56 PM
  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.
Add Comment
John Luke Accepted Answer
0
Votes
Undo
Sierra 3.1.0_11
JRE Version 1.6.0_31

No 'contains' method in code. When we upgrade to Sierra 3.2, hopefully all will be well.

Thanks for the tip.

jluke@mail.owls.lib.wi.us
Comment
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 1
Steve Heser Accepted Answer
0
Votes
Undo
Hi John,

Just wanted to throw this out there because your issue sounded similar to mine. I've been spending the last week or so updating some of our print templates that don't work with the JRE Version 1.8 Sierra client. If you're downloading the install executable for Sierra straight from the server, you might be using this version if you're on a later version of Sierra. You can check by opening Sierra and using Help > About to see the JRE Version. Most of our templates work just fine with 1.8, but I had a couple that crashed in preview mode. In my case, I was using the "contains" method and once I replaced it with another method like "matches" or "equals" it worked fine. It became an issue for us when one of our libraries used the 1.8 client with these templates and it wouldn't print. Hope that helps.

Steve

steve.heser@mcfls.org
Comment
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 2
John Luke Accepted Answer
0
Votes
Undo
I just had the library try the template with the new code. Same problem. It previews & works on one computer, but not the other. I guess we'll have to wait for another JAVA update from Oracle to see if their Computer No.2 will eventually work with the template.

Thanks again everyone for all the help!

jluke@mail.owls.lib.wi.us
Comment
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 3
Cindy Harper Accepted Answer
0
Votes
Undo
John, ignore my last comment. I was confused because my printer was coughing about needing a different paper type, that led me to believe it wasn't printing.

Sorry.

CHARPER@vts.edu
Comment
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 4
Cindy Harper Accepted Answer
0
Votes
Undo
John, I think it prints if I comment out the "Items checked out to:" + patron record number. It looks like that tries to force a null to a string???

CHARPER@vts.edu
Comment
Cindy, you're looking at line 271?

jluke@mail.owls.lib.wi.us
  1. John Luke
  2. 2 months ago
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 5
Phil Shirley Accepted Answer
0
Votes
Undo
I asked John to email me the png file; let's see if it works any better if I attach it.

pshirley@cuyahogafallslibrary.org
Attachments (1)
Phil Shirley
Technology Services Coordinator
Cuyahoga Falls Library
Comment
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 6
Cindy Harper Accepted Answer
0
Votes
Undo
I created a blank graphic for IolaGraphic.png, and uploaded the files as they existed. They Preview all right on my computer, but we don't have receipt printers and never print due slips, so I don't know if it prints with real data.

I tried editing ths statement to this:
<textFieldExpression><![CDATA[(!($F{Item_Title}==null||$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}==null||$F{Item_Barcode}.equals("";)) ? "Barcode: " + $F{Item_Barcode} + "\n" : "";) +
($F{Item_Due_Date}.length() < 8 ? "" : "<style isBold='TRUE' size='10'>DUE DATE: " + $F{Item_Due_Date}.substring(0,8) + "</style>" )]]>
</textFieldExpression>


But I think this is beyond my experience.

Cindy

CHARPER@vts.edu
Comment
I just pasted your new code in, and it does preview fine in Sierra, and prints on my label printer here on my computer just fine. Next step is to see how it performs on the libraries No.2 computer. Thanks! I hope that's it!
  1. Guest
  2. 2 months ago
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 7
John Luke Accepted Answer
0
Votes
Undo
My .png graphic won't upload properly. It's only 2KB

jluke@mail.owls.lib.wi.us
Comment
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 8
John Luke Accepted Answer
0
Votes
Undo
Here's the graphic:

jluke@mail.owls.lib.wi.us

jluke@mail.owls.lib.wi.us
Attachments (1)
Comment
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 9
John Luke Accepted Answer
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.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 10
John Luke Accepted Answer
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.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 11
Cindy Harper Accepted Answer
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.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 12
John Luke Accepted Answer
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
Can you upload your template, and I'll see if I can make it work?

Cindy

CHARPER@vts.edu
  1. Cindy Harper
  2. 2 months ago
There are no comments made yet.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 13
Cindy Harper Accepted Answer
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.
Add Comment
  1. more than a month ago
  2. Sierra/ Millennium/ Encore
  3. # 14
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,pdf,ppt,pptx,doc,docx,xls,xlsx,,txt,rtf,jrxml
• Remove Upload Files (Maximum File Size: 2 MB)
You may insert polls into your post. The poll would then appear in the post.
Vote Options
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.