EhLibSupport wrote:
Hello
Please read the next section dedicated to footers in groups.
https://www.ehlib.com/online-help/EhLib ... -in-groupsIf 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;