I found a solution here that worked in this online barcode reader.
<!-- Coloque isso após a tag de abertura <jasperReport> -->
<style name="Barcode" mode="Opaque" forecolor="#000066" backcolor="#FFFFFF" fill="Solid" hAlign="Left" vAlign="Top" markup="styled" fontName="SansSerif" fontSize="11"/>
<!-- ... -->
<detail>
<band height="125" splitType="Stretch">
<componentElement>
<reportElement style="Barcode" x="230" y="43" width="78" height="38" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true" uuid="e70dd866-d0a9-4b34-8fb1-0f0b04c9dcf3"/>
<jr:Code128 xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<jr:codeExpression><![CDATA[$F{nomedocampo}]]></jr:codeExpression>
</jr:Code128>
</componentElement>
</band>
</detail>
As for the code to be used barcode documentation clarifies:
Some of linear symbologies are highly standardized, some others are niche-oriented, Most of them presenting Mixed Features. Below are few examples:
- Universal Product Code (UPC) - International Standard ISO/IEC 15420. There are 5 versions of the UPC symbology Designed for Future Industry Previews: UPC A, B, C, D, E.
- Codabar - Outdated format used in Libraries, Blood Banks and on air waybills. Not standardized.
- Code 25 - Interleaved 2 of 5 - Used in wholesales and Libraries. International standard ISO/IEC 16390
- Code 39 - International standard ISO/IEC 16388
- Code 128 - International Standard ISO/IEC 15417
- EAN-8 - International Standard ISO/IEC 15420
- EAN-13 - International Standard ISO/IEC 15420
- JAN - Available for Japan, compatible with EAN-13 (ISO/IEC 15420)
Dai has to see which the appliance supports, usually this is said on the packaging. But being the above the main ones should work.
Credits: https://stackoverflow.com/questions/13612910/jasperreports-barcode-generation-with-barcode4j-library-depencies