Subject Re: Totaling fields in a report
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Thu, 22 Dec 2022 15:09:13 +0530
Newsgroups dbase.getting-started

Good Afternoon Charlie,
>
> But I want to get a grand sum of qty*price.  I tried this
>
> {||this.parent.parent.agSum({||this.parent.STREAMSOURCE1.rowset.fields["PRICE"].value*this.parent.STREAMSOURCE1.rowset.fields["QTY"].value})}
>
> But that does not work.  Produces a blank.  Is there a way to express this so I get a value?

I usually add calculated fields in sql itself.

select sales.*,qty*rate as amount from sales where invoice_no = 54
(Untested)

Once the sql is altered you will be able to see amount alongwith other
fields in fields pallette from where you can easily pick and drop.

As for the above statement.
Try
{||this.parent.parent.agSum(this.parent.STREAMSOURCE1.rowset.fields["PRICE"].value*this.parent.STREAMSOURCE1.rowset.fields["QTY"].value)}

This is again untested and has just small changes in brackets only.

For this report you can try this out for the rest adding fields in sql
will be more convenient.

Regards
Akshat