matthall Posted April 12, 2012 Share Posted April 12, 2012 [EDIT 13/04/12 11:20: Summary; Need new line / carriage return character for printing to Zebra printer] Hi,My colleague and I are new to iReports but are attempting to replicate some output that we currently have from StreamServe in the iReports environment.In particular (and the reason I am here) printing despatch labels on a Zebra printer.We are trying to print the address in standard address format on multiple rows. Each row may or may not have data. e.g:Name = Mr BishopAddress1 = Honeydew RoadTown = LeicesterCounty (null)PostCode = LE9 2RRWe'd want this to discount the null line (wherever it appears) and build up an address without ny blank lines e.eMr BishopHoneydew RoadLeicesterLE9 2RRWe've achieved this by passing the fields through an if statement within individual variables and building them into a final variable for the address.$V{NAME} $F{NAME}!="#"?$F{NAME} +"n":""$V{ADDRESS1} $F{ADDRESS1}!="#"?$V{Name} + $F{ADDRESS1} + "n":$V{Name}$V{TOWN} $F{TOWN}!="#"?$V{ADDRESS1} + $F{TOWN} + "rn":$V{ADDRESS1}.... and so on...The difficulty comes from getting this fully formed address variable to output on separate lines.As you can see we are attempting to use the java n andor rn commands to do this and in iReports it outputs correctly. Having published to our host system (for info: Red Prairie Dispatcher) the label printed via a Zebra printer just outputs each line one on top of another.I'm hoping that someone has experienced (and overcome) a similar issue and might advise.Many thanks,MattHall Code: Post Edited by matthall at 04/13/2012 10:21 Link to comment Share on other sites More sharing options...
matthall Posted April 18, 2012 Author Share Posted April 18, 2012 I have tried all kinds of control characters none to any avail so still wondering if anyone mightt assist.In general printing to a Zebra printer (via Red Prairie Dispatcher) seems to be troublesome so any general advice or direction to useful guides in this field would be most welcome Link to comment Share on other sites More sharing options...
CaptnTony Posted April 18, 2012 Share Posted April 18, 2012 If I understand correctly, you are trying to deal with "null" rows on the report (in this case a label), is that correct?If so, have you checked out the parameters on the textboxes that contain the $F{<fieldname>} information? There should a parameter that is called "Remove line when blank". If you check this option, the form should automatically handle the moving of data around for you by just not even trying to print that line of information.Hope this helps. Good luck! Link to comment Share on other sites More sharing options...
matthall Posted April 24, 2012 Author Share Posted April 24, 2012 Thank you. That was so much easier than I was trying to make it, I'm sure we have probably looked straight past that fields on a number of occassions. Works a charm, much appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now