Jump to content
We've recently updated our Privacy Statement, available here ×

Using Loop to Print Multiple Barcodes


2004 IR Help

Recommended Posts

By: andersons - andersons

Using Loop to Print Multiple Barcodes

2005-07-14 07:53

I am producing a report with iReport 0.5.0 which allows users to specify how many barcodes they would like printed off. This number will vary from one to four. The barcodes need to be the same for each set of multiples. For example, two barcodes for Jim, then two barcodes for Bob, etc.. I know that I could accomplish this with a for loop or something similar but I can't figure out how to produce this result.

 

I have a parameter called $P{NUMBER_OF_LABELS} which stores the value of how many labels the user would like printed off. I've tried just about everything that I can think of to accomplish this, but have come up short.

 

Thanks in advance. I hope someone out there can help me.

 

Susan

 

 

 

 

By: C-Box - c-box

RE: Using Loop to Print Multiple Barcodes

2005-07-14 12:50

Just design your barcode report with a SubReport that just prints the barcode field in its detailband... the other data are printed by your MasterReport.

 

In your SubReport-Element you say as DataSource-Expression the following:

 

new JREmptyDataSource($P{NUMBER_OF_LABELS})

 

in your SubReport-Expression you point to the SubReport-JasperFile or you pass your SubReport as "JasperReport-Object" from outside into the MasterReport also as Parameter)...

 

If your Barcode is a fieldvalue just pass that field as parameter from MasterReport to SubReport (as you tell him to use an empty JRDataSource with $P{NUMBER_OF_LABELS} empty records you can't use any other datasource

 

When I understood your problem right, I'm sure that would work! :-)

 

Hope you get what I mean?!?!?

 

hth

C-Box

 

 

 

 

By: andersons - andersons

RE: Using Loop to Print Multiple Barcodes

2005-07-14 14:15

Thanks. I will give it a try tomorrow and let you know.

 

Susan

 

 

 

 

By: andersons - andersons

RE: Using Loop to Print Multiple Barcodes

2005-07-15 08:26

I tried it this morning and it worked! Thank you so much C-box. You really helped me out.

 

Susan

 

 

 

 

By: C-Box - c-box

RE: Using Loop to Print Multiple Barcodes

2005-07-15 10:47

Fine... and your weekend is saved! :-)

 

greetings from Germany

C-Box

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...