Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / October 2004

Tip: Looking for answers? Try searching our database.

Jasper Reports - How to manage multiple pages / insert page breaks

Thread view: 
Niall Murphy - 11 Oct 2004 14:40 GMT
Hi all,

I'm using jasper reports to create a PDF document dynamically from a
java application.  However the PDF document I want to create is quite
long - 10 pages and contains lots of static text.

I've hit a problem when it comes to managing to design the PDF
documents to be over one page in length ... is there a way to insert
page breaks or format the document over several pages.  Are there xml
tags that can be used ? Could subreports or some other method be used
?

I'm also using iReport designer alongside Jasper Reports but haven't
seen how to manage multiple page documents in that tool either.

If anyone can help with this query I'd really appreciate it.

Thanks,
Niall.
Pavel L.Yatsuk - 12 Oct 2004 11:53 GMT
Hello!
Very easy
Each page in report is separated report
for example
i create 3 report with static text
then i fill this report with data and receive 3 files with extention
*.jrprint
In end i gather this files in one pdf file

for filling report with data

String sourceFileName = "file.jasper";
String printFile="file.jrprint";
JasperFillManager.fillReportToFile(sourceFileName,printFile,params,
dataSources);

for gathering files in one report

for (Iterator iter = reportFiles.iterator(); iter.hasNext();) {
            String fileName = (String) iter.next();
            try {
                printList.add(JRLoader.loadObject("file.jrprint"));
            } catch (JRException e1) {
                e1.printStackTrace();
            }
        }
        JRPdfExporter exporter=new JRPdfExporter();
        exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST,
printList);
        exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,
destFileName);
        try {
            exporter.exportReport();
        } catch (JRException e) {
            e.printStackTrace();
        }

> Hi all,
>
[quoted text clipped - 15 lines]
> Thanks,
> Niall.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.