Calculate Sum in table column per page

0

Hi there,

I try to do sum in table column per page.Everything is working, but when the one of column have large content, the calculation goes wrong. 

 

 

 

** the total amount for page 11 should be 219,000. But currently it appear 363,000 (plus 144,000) from the next page.  

zaila_1's picture
Joined: Dec 20 2017 - 9:20pm
Last seen: 2 months 2 weeks ago

Hi C-Box,

I create group and shift all the fields from details into the group and its working now.

Thank you.

zaila_1 - 5 months 3 weeks ago

1 Answer:

0

I guess your detail for the last record is actual started at page 11 and now the enginge recognized that your description is probably StretchWithOverflow=true and that's why the whole content won't fit into the remaining space at page11... so a page-break will be done and the whole detail is transferred to the page 12.

But the variable for your carry is already evaluated, as the band already started. 

So this is what I guess! (not verified, but after "some" years of using JasperReports). 

To prevent this you could either try to set the SplitType of your detail to "PREVENT"....or you could try to create a "dummy group" with an attribute "MinHeightToStartNewPage" > 30px (or an other TrialAndError value)  or you also could use another detail-band for your "splitting" content and just place the "one-line" fields including amount into the first detail.

If you look into the JasperSoft-Tracker you will find a BugReport some years ago, where I discussed the "Strange Carry Calculation" with Teodord Danciu.... When I remember right, the result of this was a new Splitting type "immediate" .... but I forgot unfortunatly what exactly this is doing. (and it just worked for simple layouts, but not complex SubReports Frames Structures)

So finally just give it a try ... the last chance would be to correct it in the generated JasperPrint Object by JavaAPI... (this is, what I did finally  ... so I just "marked" the amount fields and calculate it's contents for a Sum per page and "correct" the JRPrintText of the CarryField at the bottom per page -  not nice, but working at many customers since several years)

 

hth + regards

C-Box

C-Box's picture
2250
Joined: Jul 19 2006 - 5:58pm
Last seen: 1 week 3 days ago
Feedback
randomness