Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Executing two rptDesign files at run time
Suneel M
Hi Guys,
I am using BIRT4.2 and have a requirement of merging two reports at run time i.e. Report1.rptdesign and Report2.rptdesign files and need to have the function which is provided by Jasper reports for merging two reports at runtime.
I am not looking for merging the report output formats i.e. pdf or html.
How we can achieve the above requirement?
Thanks,
SuneelKumar M
Find more posts tagged with
Comments
Suneel M
Hi Guys,
Please give reply to the above query ASAP.
It has been posted 5 days back.
sairag
Suneel , can you please explain your requirement with an example.
Thanks
AR
Suneel M
Hi,
I have 3 rpt design files. i.e., a.rptdesign , b.rptdesign , c.rptdesign
My requirement is , i need to generate single pdf report by combining all these rpt design files.
depending upon the condition i need to change the execution order.
Let's say
on x condition : my out put will be a+b+c .pdf
on y condition : my out put will be b+c+a .pdf
on z condition : my out put will be a+c+b .pdf
Note:-
i searched this topic lot of site's. In almost all the people are mentioning , execute single rpt design file. after that merge all the pdf's . But this will not work in my case because i need page numbers continuously.
bgbaird
Suneel, it's software, if your checkbook is big enough, you can do anything. Remember, most of the folks on these boards are busy working their real jobs. Answers here can take some time.
That being said, without some deep programming, you could simply use one design with all the content exposed in it, then manage visibility based on a condition. I'll attach one possible solution:
Brian
Suneel M
Thank you for reply.<br />
I checked the examples which you have provided above.<br />
But actually, my requirement is not this.<br />
<br />
i need to combine the rptdesign files and generate the single report at run time using programming only.<br />
Is it possible in BIRT?<br />
If possible could you please provide that sample java code to achieve the above requirement<br />
<br />
Note:-<br />
I found some link on the internet.<br />
This maybe helpful for you to understanding my exact requirement <br />
<span class='bbc_underline'>
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205265</span>
; <br />
<br />
- Suneel M
bgbaird
Suneel,
I don't work in Jasper, nor am I a real JAVA coder. It is usually my LAST resort!
There are lots of them out there, and I'm sure that some of them are looking for work. I've worked with several who are very good (read $$$)
Suneel M
Hi ,
Can anyone give some solution to my problem, which i have raised above.
Suneel M
Hi Guys,
Could you please any body sort out this problem.It is very critical for my work.
It has been posted 12 days back.
mwilliams
If you run the reports separately and join them, you should still be able to add the page numbers to the joined pdf. Take a look at this blog that shows a way to combine pdf's and add page numbering:
http://java-x.blogspot.com/2006/11/merge-pdf-files-with-itext.html
Suneel M
Thank you reply.
I checked the link.In that merging pdf along with continuous numbers, they are using iText.
If we need to use itext, then we can generate pdf using itext also, why we need BIRT ?
my requirement is , i need to achieve this using BIRT only.
this is possible only two way's on BIRT.
1)executing two different rptdesign files at the same time at runtime and generate single pdf.
2) in the code level,i need to create new rpt design file by copying the one rptdesign file under the another rptdesign files .(in this case , i need to copy all the data sources,datasets, styles,... etc ) this is very complicated bcoz as per my requiremnet ,i need to merge nearly 15-20 rpt design file .
could you please Suggest ?
mwilliams
I would assume you're using BIRT for more than just its ability to create a PDF, so using iText to merge the PDF outputs would seem to be the simplest solution. If it's easier for you to bypass BIRT and create the large PDF without it, as you said, I'd do that. If you're set on merging all of your designs, using code, what are you stuck on? I have not merged two designs, in code, before, so I'd be starting where you're at.
Let me know.
Suneel M
Thank you for your reply.
1)As you mentioned, " it's easier for you to bypass multiple BIRT rptdesign files and create the large PDF
without using any other like.. itext, as you said, I'd do that."
Could you please help on this.( This is my best option so far)
2) One more thing toy mentioned in the above reply "If you're set on merging all of your designs, using code,
what are you stuck on? "
I am using the following sample code to copy rptdesign files and creating merged rptDesign.(still in starting phase)
design1= session.openDesign("D:\\BIRT-FILES\\reportDesign\\Report1.rptdesign" );
design2 = session.openDesign("D:\\BIRT-FILES\\reportDesign\\Report2.rptdesign" );
SlotHandle reportSourceBodyHandle = design1.getBody();
SlotHandle reportDestinationBodyHandle = design2.getBody();
Iterator iter = reportSourceBodyHandle.iterator();
while(iter.hasNext()){
DesignElementHandle item = (DesignElementHandle)iter.next();
DesignElementHandle cpy = item.copy().getHandle(reportSourceBodyHandle.getModule());
reportDestinationBodyHandle.add(cpy);
}
design2.saveAs("D:\\BIRT-FILES\\reportDesign\\merged.rptdesign");
design2.close();
design1.close( );
Platform.shutdown();
My probelm here is, i am able to copy only Elements , which are present in the body.
But i need to copy all the other elements like, master pages, data source, dataset, styles, images,...etc.
I don't know how the format is looks like
But this is my last option as well as time taking option also.
mwilliams
I didn't say that bypassing BIRT was easier. You had asked why you need BIRT if you have to use iText. I just said that if you can create your reports, easier, in PDF without using BIRT, then I would do that. Like I said before, the easiest way for you to get what you're wanting, it seems, since you've already created all the individual designs, would be to let BIRT create all the PDF's, then just use iText to merge them.
Suneel M
Thank you for your reply.
That means, BIRT has limitations.( only open source i did not work on ACTUATE ).
But, As per my knowledge this was the basic requirement of any reports generation.
i.e., merging of more reports at run time level with specific order.
I can't achive this merging reports(rptDesign files) functionality using BIRT only ?
Can you please provide , your final Conclusion.