Create report with barcode

Asked

Viewed 789 times

-1

I need to create a report in Jasper Studio with barcode but I am not able to read the barcode that the report is generating, my doubt is, which barcode pattern I should use, and how should I configure itlo in Jasper Studio so that the barcode reading gun can read it.

  • I am currently using Jasper Studio 5.6.0 (The tool that am using allows only up to 5.x version of Jasper Studio)

1 answer

1


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:

  1. 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.
  2. Codabar - Outdated format used in Libraries, Blood Banks and on air waybills. Not standardized.
  3. Code 25 - Interleaved 2 of 5 - Used in wholesales and Libraries. International standard ISO/IEC 16390
  4. Code 39 - International standard ISO/IEC 16388
  5. Code 128 - International Standard ISO/IEC 15417
  6. EAN-8 - International Standard ISO/IEC 15420
  7. EAN-13 - International Standard ISO/IEC 15420
  8. 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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.