Does anyone know how to print barcode with jasperreports-6.3.0 library? All the examples I've seen until now , they contain automization generators for barcode such as onbarcode, etc. Although in that library exist net.sf.jasperreports.components.barcode4j.Code128Component.
In my code I choose the field from database dynamically with that :
JRDesignTextField designField = new JRDesignTextField();
designField.setX(0);
designField.setY(0);
designField.setWidth(bar_width);
designField.setHeight(bar_height);
JRDesignExpression exp = new JRDesignExpression();
exp.setText("$F{PatientID}");
designField.setExpression(exp);
detail_band.addElement(designField);
((JRDesignSection) jasperDesign.getDetailSection()).addBand(detail_band);
It shows the IDs like : 103657 , 103658.... But I can not find the way to make them barcodes with jasper reports.
Does anyone can help here?
I try this without to give me another result :
Hello Δήμητρα,
My solution is just to add a call to the method JRDesignComponentElement.setComponentKey, passing name, prefix and namespace of the barcode component.
Here is my code, it works fine !
Don't get me started about those stupid light bulbs.