Jump to content
Changes to the Jaspersoft community edition download ×

custom barcode exporter


tommy1606

Recommended Posts

Hello,

i am currently writing a custom report exporter.

My report contains lines, text, rectangle and a barcode.

For the custom reporter i am extending JRAbstractExporter and implementing exportReport() method.

Iterating over jasperPrint.getPages() and for every page iterating over jrPrintPage.getElements.
Elements are for example JRTemplatePrintLine, JRTemplatePrintText, JRTemplatePrintRectangle and so on....
So far so good..

But the barcode element is an JRTemplatePrintImage... i guess because exporters like pdf exporter outputs svg images.
But for my custom exporter i have to output something like

BARCODE
C128B;DARK;40;15
*barcode value*
STOP

and not a svg image!

BUT I SEE NO WAY HOW TO GET THE C128B INFORMATION FROM JRTemplatePrintImage!

In the jasperDesign oder jasperReport object, the barcode is represented by net.sf.jasperreports.components.barcode4j.Code128Component class. In the jasperPrint object by JRTemplatePrintImage.
I didn't find anything like JRTemplatePrintImage.getBarcodeComponent().getBarcodeType()...

I even didn't find a way to get the text under the barcode and the text in the barcode from JRTemplatePrintImage.
 

But without barcode export possibility i can trash my exporter...
Any hint for me?

Kind regards
 

 

Link to comment
Share on other sites

  • 2 months later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Using code is too complicated for me.


As for myself, I used to generate barcode with the help of a barcode generater SDK.

It is just one of many but I do appreciate its simple way of processing.

Even though I only tried its free trial package to generate and view barcodes and didn′t check the cost and licensing conditions, it worked great for me.

Besides, this site gives a lot of choices for processing different kinds of document and image formats.

Share with you. And I hope you success. Good luck.



Best regards,
Arron
 

Link to comment
Share on other sites

  • 3 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...