Calcluted fields. 
Author Message
 Calcluted fields.

Hello Experts

Can you can help me with this problem please:

Calculated total field for a dbgrid, I have a form where all the line-items
purchase by a client are listed in a dbgrid. I have a calculated field
going down the rows that show the line-item's purchased * price. At the
bottom I wish to have a total cost of all the items calculated in a field.

Can you help please?

Could you please cc it to me as well please by removing "nospam", and
thanks in advance.

Best Regards.

Vince Chin



Wed, 27 Oct 1999 03:00:00 GMT
 Calcluted fields.

Quote:

> Hello Experts

> Can you can help me with this problem please:

> Calculated total field for a dbgrid, I have a form where all the line-items
> purchase by a client are listed in a dbgrid. I have a calculated field
> going down the rows that show the line-item's purchased * price. At the
> bottom I wish to have a total cost of all the items calculated in a field.

> Can you help please?

> Could you please cc it to me as well please by removing "nospam", and
> thanks in advance.

I don't know any way of doing this by using the standard dBGrid.
You just can't create effect, so that there is a calculated dBGrid column,
and at the last Grid row there is the sum for it.

The easy way is to look for example Delphi's MASTAPP.PAS demo program,
and see how the sum is calculated there, and shown on screen using different
TEdit component.
   Of course you can go further than this. You can use dBGrids DrawDataCell
event, where you make some calculations and align and set the TEdit's
position. After this it *looks* exactly like it would an extra dBGrid
cell, that is located just at the bottom of the calculated field.

Markku Nevalainen



Sat, 30 Oct 1999 03:00:00 GMT
 Calcluted fields.

This is a multi-part message in MIME format.
--------------95BA7AD149042127714101B9
Content-Type: multipart/alternative; boundary="------------CD7137399BE4F38F2654F99A"

--------------CD7137399BE4F38F2654F99A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Quote:

> Hello Experts

> Can you can help me with this problem please:

> Calculated total field for a dbgrid, I have a form where all the
> line-items
> purchase by a client are listed in a dbgrid. I have a calculated field

> going down the rows that show the line-item's purchased * price. At
> the
> bottom I wish to have a total cost of all the items calculated in a
> field.

> Can you help please?

> Could you please cc it to me as well please by removing "nospam", and
> thanks in advance.

> Best Regards.

> Vince Chin


 Hi:
I went through a similar problem. I posted the question to MANY
newsgroups and sources. Not one response. My problem was a bit more
complicated, but I found the easiest way was to use a string grid and do
EVERYTHING yourself using strings (convert the numeric values to
strings).
However, I am sure that somewhere out there, there is a VCL componet
grid that has got to be better.

Ken Golubski

--------------CD7137399BE4F38F2654F99A
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
<BLOCKQUOTE TYPE=CITE>Hello Experts

<P>Can you can help me with this problem please:

<P>Calculated total field for a dbgrid, I have a form where all the line-items
<BR>purchase by a client are listed in a dbgrid. I have a calculated field
<BR>going down the rows that show the line-item's purchased * price. At
the
<BR>bottom I wish to have a total cost of all the items calculated in a
field.

<P>Can you help please?

<P>Could you please cc it to me as well please by removing "nospam", and
<BR>thanks in advance.

<P>Best Regards.

<P>Vince Chin

&nbsp;Hi:
<BR>I went through a similar problem. I posted the question to MANY newsgroups
and sources. Not one response. My problem was a bit more complicated, but
I found the easiest way was to use a string grid and do EVERYTHING yourself
using strings (convert the numeric values to strings).
<BR>However, I am sure that somewhere out there, there is a VCL componet
grid that has got to be better.


--------------CD7137399BE4F38F2654F99A--

--------------95BA7AD149042127714101B9
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ken Golubski
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Ken Golubski
n:              Golubski;Ken
adr:            ;;;Westlake;Ohio;;USA

x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
end:            vcard

--------------95BA7AD149042127714101B9--



Wed, 03 Nov 1999 03:00:00 GMT
 Calcluted fields.

I'm not an expert, but...

I am assuming you want a total by client.  Otherwise, you could just show a
grand total (for all clients) in a label below the grid.

One way to do this would be by using a TQuery to build a table of total
purchases by client.  Then use a second TQuery to get a union of the actual
detail table and the totals table.  The grid would show the resulting
dataset.

Ed


Quote:


>> Calculated total field for a dbgrid, I have a form where all the
>> line-items
>> purchase by a client are listed in a dbgrid. I have a calculated field

>> going down the rows that show the line-item's purchased * price. At
>> the
>> bottom I wish to have a total cost of all the items calculated in a
>> field.

-----



Wed, 03 Nov 1999 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. To add a field of the type Dates with a field of the Whole type

2. Update a field with time stamp when other field are updated

3. Breaking data in a field into multiple fields

4. Converting 2 char for month and year fields to single date field

5. SQL Query problem concat text field from mulitple rows into one text field

6. null field of field type date

7. Query datetime-field by date when field contains date + time

8. Access Ole Field to SqlServer Image Field

9. Update field with other fields data minus one day

10. calculated field based on another calculated field

11. A Varchar(1000) field vs 1000 Bit fields

12. Select distinct for certain fields but show all fields


 
Powered by phpBB® Forum Software