Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display sum of two fields on grid
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00448679
Message ID:
00448688
Views:
8
>>>Hello all,
>>> I have a grid show a list of record each with two numeric fields, I want to use an additional column to show the sum of that two fields on the fly. how can I do this?
>>>
>>>Because I don't want to define that 'sum' field on tabel structure, I have following problems:
>>>-I have try use local view, but local view have no index, so I can't use it to link to parent record.
>>>-I have try the assign method of that tow field to update the sum column display, but it is unreliable that all row's 'sum' column display the current record's 'sum'
>>>-I have try to create a temp table which have that 'sum' field and link to my table. And set the controlsource of column 'sum' to that temp table, but it also doesn't work.
>>>
>>>Could you help me?
>>>-Jasper
>>
>>Jasper,
>>Try creating the view again but this time, open it with NODATA. Create the necessary index. Because there are no records, the index creation will be very fast *g*. Then requery the view. This should populate your summary field as well as provide a means of linking it to the parent table.
>>
>>HTH.
>
>Dear Larry,
> How to create index on local view? I can't see any options to create index in View Designer.
>Thanks. ^_^
>-Jasper

PMFJI, but you have to set the buffering mode on the view to ROW buffering (3):

SELECT 0
USE lv_MyView NODATA
CURSORSETPROP("BUFFERING", 3)
INDEX ON MyField TAG MyTag
REQUERY()
Chris McCandless
Red Sky Software
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform