custom barcode exporter

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
 

 

tommy1606's picture
Joined: Apr 8 2013 - 8:12am
Last seen: 4 months 4 weeks ago

1 Answer:

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 yo\u success. Good luck.



Best regards,
Arron
 

arronwall1's picture
Joined: Jul 5 2013 - 2:59am
Last seen: 6 years 11 months ago

hey,i used qr code barcode (http://www.keepautomation.com/products/android_barcode/barcodes/qrcode.html) on my android,but i did not find an available barcode reader(http://www.keepautomation.com/products/net_barcode_reader/barcode_codaba...) on it,does your site support this ?

mariahsharp468 - 8 years 11 months ago
Feedback