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 3803410
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:21:31+00:00 2026-05-19T14:21:31+00:00

Using JasperReports 3.7.6 (with iReport) for generating a report that spans on two pages:

  • 0

Using JasperReports 3.7.6 (with iReport) for generating a report that spans on two pages: report has a table of 18 columns of data, columns from 1 to 10 on the first page and from 11 to 18 on the second, one record of data is displayed on two pages, and lots of data may be gathered. I tried to search of forums, asked question on jasper forum and got no answer.

What will solve this problem?

  • 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-05-19T14:21:32+00:00Added an answer on May 19, 2026 at 2:21 pm

    1) this is clear I think, but..just make each page of multi page report separated.

    2) compose all separated pages in one using copy/pasting XML from one report to another, in the end the only one report will exist and it will contain all elements (which was separated before)

    3) write datasource, may be this will suite you:

    private final List data; private final Iterator iterator;
    
    private List<IRecord> buffer;
    private Iterator<IRecord> bufferIterator;
    
    private IRecord currentValue;
    
    private int pageCount;
    private int pageRowNum;
    
    private boolean useBuffer;
    private int position;
    private int counter;
    
    public MultiPageReportDataSource(List<? extends IRecord> data, int pageRowNum, int pageCount) {
        this.data = data;
        this.iterator = this.data.iterator();
        this.buffer = new LinkedList<IRecord>();
        this.bufferIterator = this.buffer.iterator();
        this.pageRowNum = pageRowNum;
        this.pageCount = pageCount;
        this.counter = pageCount;
    }
    
    @Override
    public boolean next() throws JRException {
        if (position > 0 && position % pageRowNum == 0) {
            counter--;
            if (counter == 0) {
                buffer.clear();
                useBuffer = false;
                counter = pageCount;
            } else {
                useBuffer = true;
                bufferIterator = buffer.iterator();
            }
            position = 0;
        }
        if (useBuffer) {
            if (bufferIterator.hasNext()) {
                currentValue = bufferIterator.next();
            }
        } else {
            if (iterator.hasNext()) {
                currentValue = iterator.next();
                buffer.add(currentValue);
            } else {
                return false;
            }
        }
        position++;
        return true;
    }
    
    @Override
    public Object getFieldValue(JRField jrField) throws JRException {
        Field field = ReflectUtil.field(CashierReportEntity.class, jrField.getName());
        try {
            return ReflectUtil.accessible(field).get(currentValue);
        } catch (IllegalAccessException e) {
            throw new JRException(e);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm generating an HTML report for showing table data in a web application, using
I am developing report containing sub report using iReport and i am passing two
I'm new to JasperReports. I'm designing a report using iReport. I have three values
I am using List component iReport the data is populating but the pdf has
I'm generating a PDF using JasperReports from Java. I finally succeeded in making Jasper
I'm using JasperReports engine, and one of the reports gets data from database executing
I'm using JasperReports with JavaBeans (I need to print reports in a application that
Using C#, I need a class called User that has a username, password, active
I'm using Web Services to run some reports created in iReport on JasperReports Server.
I'm working with iReport 3.5.0, and I'm using a subreport inside my main report.

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.