Adding a column in an embedded view

I have a form with an single category embedded View. One of the columns in the embedded view contains a currency field. On the main form I wish to have a computed field that will contain the total of the currency colum. Is there an easy way of doing this ?

thanks in advance for any help ?

Subject: Adding a column in an embedded view

Paul,

I don;t think there is an easy way - you would need to loop through all the documents and total up the values to display on the main form

You could always show the total on the embedded view, but I assume you need the total in a field on the main form so that you can use it in a calculation?

Subject: Adding a column in an embedded view

You can add two computed fields, one multivalue field and another Number field. Use DBColumn to get all the currency values into the multivalue field. Sum up these values in the other field. You can hide the multivalue field, if you want so that the total will be displayed as per your requirement.

Subject: Use the view itself

The Embedded single category view is just that a viiew lets called it “Embedded”

the Embedded view is categorised on the first column

(and hence is suitable for a @DBLookup)

It ss displaying the number to be summed in a column

lets say 3

When embedded is owing a category

based on an field or expression on the main form

lets say that is a Field Key.

SO …

we can add a Computed field on the main form

V := @Dblookup( “” ; “” ; “Embedded” ; Key ; 3 ) ;

@if( @isError(V) ; 0 ; @sum( V ) )

If the number of documents in the embbedded view changes

or even if any data is changed e.g. by opening an embedded document

you need to have the main document refreshed some how

but if its read only thats pretty much it.

have fun

(BTW: There are also script equivalents but this is the first thing to try )