Recent

Author Topic: Lazreport sum function errors on fields of type Double  (Read 4105 times)

snorkel

  • Hero Member
  • *****
  • Posts: 796
Lazreport sum function errors on fields of type Double
« on: November 08, 2012, 08:48:11 pm »
Hi,
Trying to port a delphi app that used fast reports.  This is in Laz 1.0.2 by the way on Win 7
Data is being pulled from a MS Access db via ODBC.

The sum function looks like this:
[SUM(<AccountQuery."Market Value">,MasterData2)]

Anyway the report uses a group header and foot and I just want to sum the field in the GROUP footer and I get this:

Invalid variant operation Ref to $0918 < Double.

Anyone have any ideas?

Thanks,

Snorkel
« Last Edit: November 08, 2012, 11:36:23 pm by snorkel »
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 1.8 and FPC 3.0.4
OS: Windows 10 64 bit

snorkel

  • Hero Member
  • *****
  • Posts: 796
Re: Lazreport sum function errors on fields of type Double
« Reply #1 on: November 08, 2012, 11:35:23 pm »
been hacking around with this all afternoon and I simply can't get it to work.
the actual field def is for a float.
It seems the only aggregate function I can get to work is COUNT,
tried MAX and MIN and those raised the same error.

The values it's trying to sum are:
55056.36
202.63

Nothing fancy here, it should be able to sum this.
« Last Edit: November 08, 2012, 11:39:14 pm by snorkel »
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 1.8 and FPC 3.0.4
OS: Windows 10 64 bit

sylvanus67

  • New Member
  • *
  • Posts: 25
Re: Lazreport sum function errors on fields of type Double
« Reply #2 on: November 09, 2012, 08:18:44 am »
not

[SUM(<AccountQuery."Market Value">,MasterData2)]

but

[SUM([AccountQuery."Market Value"],MasterData2)]


snorkel

  • Hero Member
  • *****
  • Posts: 796
Re: Lazreport sum function errors on fields of type Double
« Reply #3 on: November 09, 2012, 04:32:04 pm »
Hey, thanks, that worked.
What happened was the function insertion in the memo editor stopped working and I copied that line from
the delphi fast reports version, I just assumed they would be the same...guess not.

I did get the function/field insertion working after rebooting and rebuilding the IDE a couple of times, not sure what happened there.

Thanks again for spotting the [] vs <>
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 1.8 and FPC 3.0.4
OS: Windows 10 64 bit