View Issue Details

IDProjectCategoryView StatusLast Update
0033629FPCPackagespublic2018-04-22 18:34
ReporterStephanoAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0033629: fpreport: Aggregates give wrong results upon ordering of master dataset
Description- Open the attached report
- Preview it
- Add to the department SQL (master dataset) "ORDER BY DEPT_NO"
- Preview it
The aggregate sums for many departments in the ordered preview is wrong, and probably just shuffled.
For instance, Engineering dept's sum should be 132,900.00 whereas it shows as 189,042.94 (which is the sum for "Field Office: East Coast")
Attached are 2 pdf's showing the output for both cases.
TagsNo tags attached.
Fixed in Revision38810
FPCOldBugId0
FPCTarget
Attached Files

Activities

Stephano

2018-04-22 10:43

developer  

MasterDetailGroupedListFB.json (43,990 bytes)

Stephano

2018-04-22 10:43

developer  

MasterDetailGroupedListFB.pdf (183,152 bytes)

Stephano

2018-04-22 10:43

developer  

MasterDetailGroupedListFB-ordered.pdf (183,553 bytes)

Michael Van Canneyt

2018-04-22 11:15

administrator   ~0107910

Very strange.

The aggregate calculation in no way depends on ordering of the dataset.
(other than that it supposes the datasets are 'correctly' sorted)

Michael Van Canneyt

2018-04-22 11:39

administrator   ~0107912

Can you please try again? I can no longer reproduce this.

Stephano

2018-04-22 12:12

developer  

MasterDetailGroupedListFB-ordered.json (44,008 bytes)

Stephano

2018-04-22 12:14

developer   ~0107913

I updated fpc and lazarus again just in case, and I can still reproduce.
Just to make sure, i attached the ordered report which gives the wrong sums.
Please check the Engineering dept's sum.

Michael Van Canneyt

2018-04-22 16:56

administrator   ~0107922

Tried with your new file, same result: all is OK. Very strange. Maybe some initialization issue.

Stephano

2018-04-22 17:20

developer   ~0107924

Initialization issue indeed :)
Follow the exact steps:
- Open the non ordered report
- Preview
- Click on Report Data and add the "ORDER BY DEPT_NO" to department SQL
- Preview
The bug is there.
If you omit the 1st preview step above, the aggregates seem to be correct.

Michael Van Canneyt

2018-04-22 17:58

administrator   ~0107927

Fixed.
Indeed initialization, the list of aggregate values was not cleared between runs...

Many thanks for the testing !!

Issue History

Date Modified Username Field Change
2018-04-22 10:43 Stephano New Issue
2018-04-22 10:43 Stephano File Added: MasterDetailGroupedListFB.json
2018-04-22 10:43 Stephano File Added: MasterDetailGroupedListFB.pdf
2018-04-22 10:43 Stephano File Added: MasterDetailGroupedListFB-ordered.pdf
2018-04-22 10:44 Stephano Assigned To => Michael Van Canneyt
2018-04-22 10:44 Stephano Status new => assigned
2018-04-22 11:15 Michael Van Canneyt Note Added: 0107910
2018-04-22 11:39 Michael Van Canneyt Note Added: 0107912
2018-04-22 11:39 Michael Van Canneyt Status assigned => feedback
2018-04-22 12:12 Stephano File Added: MasterDetailGroupedListFB-ordered.json
2018-04-22 12:14 Stephano Note Added: 0107913
2018-04-22 12:14 Stephano Status feedback => assigned
2018-04-22 12:15 Stephano Description Updated View Revisions
2018-04-22 16:56 Michael Van Canneyt Note Added: 0107922
2018-04-22 17:20 Stephano Note Added: 0107924
2018-04-22 17:58 Michael Van Canneyt Fixed in Revision => 38810
2018-04-22 17:58 Michael Van Canneyt Note Added: 0107927
2018-04-22 17:58 Michael Van Canneyt Status assigned => resolved
2018-04-22 17:58 Michael Van Canneyt Fixed in Version => 3.1.1
2018-04-22 17:58 Michael Van Canneyt Resolution open => fixed
2018-04-22 17:58 Michael Van Canneyt Target Version => 3.2.0
2018-04-22 18:34 Stephano Status resolved => closed