Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 17:27

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 18 Mar 2024, 10:16 
Offline

Joined: 14 Mar 2024, 14:13
Posts: 5
Hello,

How to make displaying summing records in groups DBGridEh ?

Thanks
Donoharjo


Top
 Profile  
 
PostPosted: 18 Mar 2024, 10:29 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello


Please read the next section dedicated to footers in groups.
https://www.ehlib.com/online-help/EhLib ... -in-groups

If something is not clear, ask a clarifying question.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 19 Mar 2024, 06:21 
Offline

Joined: 14 Mar 2024, 14:13
Posts: 5
EhLibSupport wrote:
Hello


Please read the next section dedicated to footers in groups.
https://www.ehlib.com/online-help/EhLib ... -in-groups

If something is not clear, ask a clarifying question.



Yes, I have studied it and tried to translate the information into code, but the footer sum is not there when the program is run. Am I wrong in translating the information into code?

Here's the code I use:

Code:
// Menyiapkan data grouping
   DBGPiutang.DataGrouping.Active := True;

   // Menambahkan level grup
   gl := DBGPiutang.DataGrouping.GroupLevels.Add;
   gl.Column := DBGPiutang.FieldColumns['Divisi'];

   // Ekspansi node grup
   DBGPiutang.DataGrouping.GroupLevels[0].ExpandNodes;

   // Menambahkan footer ke setiap grup
   for k := 0 to DBGPiutang.DataGrouping.GroupLevels.Count - 1 do
   begin
      Footer := TGridDataGroupFooterEh(DBGPiutang.DataGrouping.Footers.Add);
      Footer.Visible := True;
      Footer.ParentColor := True;
      Footer.ParentFont := True;
      Footer.ShowFunctionName := True;

   // Menyiapkan item footer untuk setiap kolom
   if Assigned(Footer.ColumnItems) then
   begin
      for j := 0 to DBGPiutang.Columns.Count - 1 do
      begin
         // Konfigurasi ColumnItem untuk kolom yang diinginkan
         if DBGPiutang.Columns.Items[j].FieldName = 'SisaFaktur' then
         begin
            ColumnItem := TGridDataGroupFooterColumnItemEh(Footer.ColumnItems.Add);
            ColumnItem.Alignment := taRightJustify;
            ColumnItem.Color := clYellow;
            ColumnItem.DisplayFormat := '###,###';
            ColumnItem.ShowFunctionName := True;
            ColumnItem.RunTimeCustomizable := True;
            ColumnItem.ValueType := gfvSumEh; // Fungsi untuk menjumlahkan nilai
         end;
      end;
   end
   else
   begin
      ShowMessage('Footer.ColumnItems is not initialized!');
   end;

   end;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group