Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8564217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:08:47+00:00 2026-06-11T17:08:47+00:00

I’ve got a barcode report which is using a sequence ( Oracle backend) to

  • 0

I’ve got a barcode report which is using a sequence (Oracle backend) to generate my barcode numbers.

This is in my query:

SELECT to_char(PALLET_ID_NO_SEQ.nextval) FROM dual

I placed this field in designer window which will display the barcode value.

I have an image with expression:

new com.pepkorit.BarbecueRotateRenderer(
    net.sourceforge.barbecue.BarcodeFactory.createCode128C(
    $F{TO_CHAR(PALLET_ID_NO_SEQ.NEXTVAL)}), false, true, 1, 50, 190, 50)

The above is the barcode using the sequence value.

I want to be able to say to print/generate 100 or more reports. At this moment I’m able to generate only one report at a time.

So my first guess is to get a parameter that prompts the user a value and that value will indicate how many barcodes to be printed and each with an individual number.

I’m not sure that my ideas about solving this problem are right and how to do it.

Can someone please help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:08:48+00:00Added an answer on June 11, 2026 at 5:08 pm

    It can be easily done with small modifying of your query without programming in several ways.

    Solution 1. Using single report with Barcode component in Detail band

    You can use single report’s template for generating several barcodes in one report.

    In this case the queryString expression (works for Oracle DB) will be like this:

    SELECT seq_barcode.nextval AS barcode, rownum FROM dual CONNECT BY LEVEL <= $P{quantity}
    

    – it is generates a value from the sequence as many times as you need. The $P{quantity} parameter determines the number of rows (barcodes) to be generated.

    The working rjxml file:

    <jasperReport ...>
        <parameter name="quantity" class="java.lang.Integer">
            <defaultValueExpression><![CDATA[20]]></defaultValueExpression>
        </parameter>
        <queryString>
            <![CDATA[SELECT seq_barcode.nextval AS barcode, rownum FROM dual CONNECT BY LEVEL <= $P{quantity}]]>
        </queryString>
        <field name="BARCODE" class="java.lang.Integer"/>
        <field name="ROWNUM" class="java.lang.Integer"/>
        <title>
            <band height="82" splitType="Stretch">
                <textField>
                    <reportElement x="145" y="18" width="240" height="20"/>
                    <textElement/>
                    <textFieldExpression><![CDATA["The number of barcodes is: " + $P{quantity}]]></textFieldExpression>
                </textField>
            </band>
        </title>
        <detail>
            <band height="47" splitType="Stretch">
                <componentElement>
                    <reportElement x="145" y="10" width="200" height="28"/>
                    <jr:barbecue xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" type="2of7" drawText="false" checksumRequired="false">
                        <jr:codeExpression><![CDATA[$F{BARCODE}]]></jr:codeExpression>
                    </jr:barbecue>
                </componentElement>
            </band>
        </detail>
    </jasperReport>
    

    The result will be ($P{quantity} == 5):

    The result via preview in iReport


    In your case the queryString expression will be like this:

    SELECT to_char(PALLET_ID_NO_SEQ.nextval) AS barcode, rownum FROM dual CONNECT BY LEVEL <= $P{quantity}
    

    and the expression of Barcode component will be:

    new com.pepkorit.BarbecueRotateRenderer(
        net.sourceforge.barbecue.BarcodeFactory.createCode128C($F{barcode}),
        false, true, 1, 50, 190, 50)
    

    Solution 2. Using Group Header band

    You can use the same queryString expression as in the first solution. The group on rownum field will help us to generate single report with many barcodes belonging to its own group (one group – one barcode). The Barcode component should be placed to the Group Header band.

    Using the isStartNewPage property we can manage to generate group on new page or not.

    The rjxml file:

    <jasperReport ...>
        <parameter name="quantity" class="java.lang.Integer">
            <defaultValueExpression><![CDATA[20]]></defaultValueExpression>
        </parameter>
        <queryString>
            <![CDATA[SELECT seq_barcode.nextval AS barcode, rownum FROM dual CONNECT BY LEVEL <= $P{quantity}]]>
        </queryString>
        <field name="BARCODE" class="java.lang.Integer"/>
        <field name="ROWNUM" class="java.lang.Integer"/>
        <group name="rownumGroup" isStartNewPage="true">
            <groupExpression><![CDATA[$F{ROWNUM}]]></groupExpression>
            <groupHeader>
                <band height="50">
                    <componentElement>
                        <reportElement x="145" y="11" width="200" height="28"/>
                        <jr:barbecue xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" type="2of7" drawText="false" checksumRequired="false">
                            <jr:codeExpression><![CDATA[$F{BARCODE}]]></jr:codeExpression>
                        </jr:barbecue>
                    </componentElement>
                </band>
            </groupHeader>
        </group>
        <title>
            <band height="82" splitType="Stretch">
                <textField>
                    <reportElement x="145" y="18" width="240" height="20"/>
                    <textElement/>
                    <textFieldExpression><![CDATA["The number of barcodes is: " + $P{quantity}]]></textFieldExpression>
                </textField>
            </band>
        </title>
    </jasperReport>
    

    In case isStartNewPage=”false” for group rownumGroup the result will be ($P{quantity}== 7):

    The result via preview in iReport, isStartNewPage="false"

    In case isStartNewPage=”true” for group rownumGroup the result will be ($P{quantity} == 5):

    The result via preview in iReport, isStartNewPage="true"

    Solution 3. Using subreport

    We can add Subreport component to the Detail band (see first solution) or Group Header (see second solution) band. In this case you can add to the subreport not only the Barcode component, but everything you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an array which has BIG numbers and small numbers in it. I
I'm trying to select an H1 element which is the second-child in its group
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.