Solved

TCRDBGrid summary problem

Posted on 2004-03-24
7
1,660 Views
Last Modified: 2010-05-18
Hi,

I have 2 CRDBGrids, one master, second details.
In the details grid I have a summary tab which shows a sum of one column.

The problem is, the sum doesn't change when I select the different record in the master grid. It always shows the sum of the first record in the grid.
I'm using ADO queries reading data from access database for these grids.

How would I fix this problem?

Thanks,
Dragan
0
Comment
Question by:cP6uH
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10669155
ARe you using a Calculated Field to show the Sum?

Shane
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 50 total points
ID: 10669197
Calculated Fields are only for display purposes only,
They are not Real (Persistent) Fields they only exist in Memory.
You CANNOT Search or Sort on Calculated Fields.
So, be aware that Calc. Fields are not real.

To use a Calculated Field, you have to do 2 things
        -Create a New field for a Table using the Fields Editor
                (Right Click on Table and select Fields Editor
        -Use the Table's OnCalcFields Event, to do the calculation and put the data in the Calc. Field
                e.g.
        n1:=T1.FieldByName('N1').AsInteger;         // N1 and N2 are Real Fields
        n2:=T1.FieldByName('N2').AsInteger;
        T1.FieldByName('CalcN3').AsInteger:=n1+n2; // CalcN3 is a Calculated Field (not real)

Shane
0
 

Author Comment

by:cP6uH
ID: 10669317
No, I'm not using calculated field.

I'm using CRDBGrid which has an option to show a sum of the column in the summary tab (dgeSummary).
The way you set it up is: set OptionEx property to ([dgeEnableSort,dgeLocalFilter,dgeSummary]).
Then edit the columns of the grid, and select the column and change the SummaryMode to smSum.

It works fine for the first record when I run the App, but when I select a different record, the sum still shows the sum for the first record in the master grid.

Dragan
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 11

Expert Comment

by:shaneholmes
ID: 10669378
Sorry, never heard of a CRDBGrid......Who makes it?

Shane
0
 

Author Comment

by:cP6uH
ID: 11382625
Admin, can you please close this question.
I have fixed this problem.

thanks
0
 
LVL 2

Expert Comment

by:Kanan
ID: 12053305
Hi.

I have almost the same problem. There is no data on summary tab at the very begining

Kanan
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month3 days, 21 hours left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question