Jump to content
We've recently updated our Privacy Statement, available here ×

ssobocik

Members
  • Posts

    2
  • Joined

  • Last visited

ssobocik's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Thank you for your answers. I wasn't able to find a solution, so I found a workaround. I've just simply fixed the row height to the heighest textfield in my report, so that all rows are the same height. In my specific situation i'm generating the jasperReport completly througn java code using Jasper API, so I was able to achieve that. I'm aware it is not very pretty, but it works in my situation: Firstly I generate report with isStretchWithOverflow set to "true" in my textFields. Then I fill it with JasperFillManager.fillReport(jasperReport, parameters, jrBeanCollectionDataSource); which gaves mi JasperPrint object, and trough analyzing it recursively I am able to find the highest textField. Then I generete once again whole JasperReport but I set height of every textField in my detail band to the heigh of the heighest textField. Thanks to that every row in my detail band have the same height, so jasper engine in advance know how many rows fill fit onto page and can properly calculate sum on page.
  2. Hello.This is my first post here. My native language is not English, so sorry for any language errors. I have to generate a report, which has a sum of values in rows on each page.I've added variable with reset type set to ResetTypeEnum.PAGE. <variable name="variablePageSum" class="java.math.BigDecimal" resetType="Page" calculation="Sum"> <variableExpression><![CDATA[$F{myField}]]></variableExpression> <initialValueExpression><![CDATA[bigDecimal.ZERO]]></initialValueExpression></variable> I've added textfield into columnFooter band with text field expression like: <textField isStretchWithOverflow="true" evaluationTime="Page" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="115" height="50"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA["Sum on page: " + $V{variablePageSum}+ "\n No of rows displayed on page: " + $V{PAGE_COUNT}]]></textFieldExpression></textField> It should display calculated sum of fields displayed on page and how many rows is on page. It works correctly only if I configure textFields is my detail band not to stretchWithOverflow.When I set my rows to stetch dynamically to display whole texts, it displays correctly but on some pages sum and PAGE_COUNT variable take into account one more row than actually is added on the page. For example: On page I see 7 rows, but sum is calculated of those 7 and 1 from next page. PAGE_COUNT gives 8. What is worse, on next page row, which already has been added to sum on previous page is also being added :( Has anyone met with this problem before? Please note, that I have to be able stretch rows to display given String data. I'm not allowed to trim it.
×
×
  • Create New...