Anand Soni
Anand Soni

Reputation: 5110

How to get the total row count?

I want to get total row count in iReport. The intention is to print a label based on the total row count.

My Format is like this (Assume that there are 10 records):

    This is page 1

    No Name Add
    1  ---- ---
    2  ---- ---
    3  ---- ---
    4  ---- ---
    5  ---- ---

    cont...2


    This is page 2

    No Name Add
    6  ---- ---
    7  ---- ---
    8  ---- ---
    9  ---- ---
    10 ---- ---

How do I get all record count before printing the report?

Upvotes: 14

Views: 57640

Answers (2)

mdahlman
mdahlman

Reputation: 9390

Use the built-in variable iReport $V{REPORT_COUNT}.

Also, if you're interested in the final value, set the text field's evaluation time to "Report".

Upvotes: 29

Meeza S
Meeza S

Reputation: 760

Put the $V{REPORT_COUNT} in the detail section of your report along with your other fields.

It will display the values in sequence as you mentioned in your question.

  1. create a variable drag and drop
  2. in the detail section right click on the item
  3. click on edit expressions
  4. in fx variables you will see REPORT_COUNT

Upvotes: 2

Related Questions