Sums don't work in Group Band

edited 5:14PM in FreeReport
I have a simple report where the query has a dept group on it. In the report I have it grouping by department and displaying a count and sum of certain fields. The report stops printing after the first group is printed. If I remove the sum fields and leave the count, everything gets printed as it should. Why won't the sum of fields work in FreeReports?

Version 2.31, Delphi 6 Pro.

Thanks

Don Gollahon

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:14PM
    Hi Don
    I don't actually know what all is included or retricted in free report.
    but if data is from a tble it must be presorted to meet group conditions.
    if a query orderby clause must meet grouping conditions.
    try extended syntax with sum function
    [Sum([tblename."fieldname'],mdbandname)]
    if that still won't work try using your own variables initialize to 0 in group header obp event and add to them in obp event of master data band
    myvar = 0
    in mdband myvar := [myvar] +[tablename."fieldname"]
    ;)
  • edited 5:14PM
    Nice one gordk, but FreeReport does not have events.

    But your final solution will work if you put it on the script of the band or any other control, caution has to be taken in order not to leave the last record unsummed.

Leave a Comment