Jump to content
Changes to the Jaspersoft community edition download ×

Generate same data with multiple copies in single PDF


joshi.nie

Recommended Posts

Hello All,

            I am using ireport designer 5.1.0 , accordong to the requirement i need to generate a report where it will contain no of items imported in a warehouse, this i can do easily, but i m banging my head over creating same pdf with 3 times merged into a same pdf. So the inspection guy can take the print out keep one copy to himself and share the rest with other offical purpose.

For example: If items ITEM001, ITEM002, ITEM003 are recorded. I need to generate like

Copy - 1

             Items          SL No

             ======      =======

             ITEM001          1

             ITEM002          2

             ITEM003          3

Copy - 2

             Items          SL No

             ======      =======

             ITEM001          1

             ITEM002          2

             ITEM003          3

Copy - 3

             Items          SL No

             ======      =======

             ITEM001          1

             ITEM002          2

             ITEM003          3

             I have followed the this post -  http://stackoverflow.com/questions/10912710/ireport-multiple-copies-of-same-report-with-different-label

             so far I am able to create a 3 sets of data, but how to make sure the header details should be repeated only for each Sets of data (ie. for Copy1, Copy2 ,Copy3) & how can i calculate the sl no in each set.

             Kindly help me.

Regards,,

  Amit

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi,

 

From what you are saying I understand you are producing a data set that has the 3 records multiplied by 3, so you end up with a data set that has 9 records in it.

That is good.

 

The question is: how do you produce this dataset. Do you have an SQL query? If so, why don't you add a new column to your SQL query in which you specify the group number. You can exploit the extra column in the report by using it as a report field in the expression of a report group.

 

Having a group break every time that column changes its value allows you to put the CopyN and the SL No fields in the group header section.

 

I hope this helps.

Teodor

 

Link to comment
Share on other sites

@teodord, thanks for reply, as u have suggested i do have an extra column which would speciify the group no for each record. Foll. is the sql query.

 

=====================================================================

 

SELECT

copy, item_master.`id` AS item_master_id, sequence

 

FROM

`item_master` item_master

CROSS JOIN

(

Select 'COPY1' as copy, 1 as sequence

UNION

SELECT 'COPY2' as copy, 2 as sequence

UNION

SELECT 'COPY3' as copy, 3 as sequence

) x

GROUP By COPY, item_master.`id`

Order By COPY

 

=====================================================================

 

"You can exploit the extra column in the report by using it as a report field in the expression of a report group. Having a group break every time that column changes its value allows you to put the CopyN and the SL No fields in the group header section."

 

I didn't get the above part in your post. Since i am new to this ireport designer. If u can provide any possible resources. I might be of great help.

 

Thanks,

Amit

Link to comment
Share on other sites

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...