Jump to content

iReports 3.5.1 -- "SUM" a field


runner1549

Recommended Posts

I have a basic report , showing WEIGHT as "java.math.BigDecimal", ran the report, and it extracted the attached 1.jpg.

I then added a textfield to the "PageFooter", made "Text Field Expression  = sum($F{FMWEIGHTPCT})", ran the report, and it failed.

How can I display the total FMWEIGHTPCT ?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Below is the answer:

SETUP
 1. create a new report
 2. add below SQL
      SELECT fmr.FMCODE, fmfe.FMWEIGHTPCT
      FROM FMFORMULAEXPANDED fmfe
      INNER JOIN FMFORMULA fmf
      ON fmf.FMENTITYOBJECTID = fmfe.FMFORMULAID
      INNER JOIN FMRESOURCE fmr
      ON fmfe.FMRESOURCEID = fmr.FMENTITYOBJECTID
      Where fmf.fmcode = 'XKIBBMVS'
      order by fmfe.FMWEIGHTPCT desc
 3. run report
 4. works
------------------------------------------------------------
OPTION #1
 5. make Summary's bandHeight = 20
 6. drop "Fields / FMWEIGHTPCT" onto Summary
 7. works
------------------------------------------------------------
OPTION #2
 5. click "$F{FMWEIGHTPCT}" to find it's type = BigDecimal
 6. create a new "Variable"
      ** Calculation = Sum
      ** Name = FMWEIGHTPCT_1
      ** Reset Type = Report
      ** Variable Class = java.math.BigDecimal
      ** Variable Expression = $F{FMWEIGHTPCT}
 7. drop "Variables / FMWEIGHTPCT_1" onto Summary
 8. works

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