Page 1 of 1
Can't implement Totals using C++
Posted: Thu Aug 02, 2018 2:04 am
by 18684102
Hello,
I want to add totals to my grid using C++ but can't do that.
I'm using the example of the getting started guide under "Totals and SubTotals" title, but it is Delphi code.
When I try to translate this code to C++ it fails because the following error message: "undefined symbol TColumnsTotals".
Could you show me how can I implement totals in C++?
Thanks in advance,
Patricio
Re: Can't implement Totals using C++
Posted: Fri Aug 10, 2018 12:59 am
by 18684102
PCZ wrote: ↑Thu Aug 02, 2018 2:04 am
Hello,
I want to add totals to my grid using C++, but I can't do that.
I'm using the example of the getting started guide under "Totals and SubTotals" title, but it is Delphi code.
When I try to translate this code to C++ it fails because the following error message: "undefined symbol TColumnsTotals".
Could you show me how can I implement totals in C++?
Thanks in advance,
Patricio
No one has knowledge about how to use TeeGrid with C++ Builder that could help me?
Any help or tip would be appreciated.
Regards,
Patricio
Re: Can't implement Totals using C++
Posted: Thu Oct 11, 2018 11:17 am
by Marc
Hello Patricio,
Apologies for having left you unattended with you query.
For the record; an example of implementation of totals by code in C++ would be as follows:
Code: Select all
#include "Tee.Grid.Totals.hpp"
TGridFooter *footer = TeeGrid1->Footer;
TColumnTotals *totals = new TColumnTotals(footer);
totals->Calculation.Clear();
totals->Calculation.Add(TeeGrid1->Columns->Items[0],Sum); //or Count, etc
The Column may be accessed by name.
Regards,
Marc Meumann
Re: Can't implement Totals using C++
Posted: Fri Dec 21, 2018 8:05 pm
by 18684102
Hi Marc,
Unfortunatelly I have an error message using exactly the same sample code that you sent me (except for the name of the grid.
This is my code:
Code: Select all
// These lines are present from previous versions
//---------------------------------------------------------------------------
#include "Tee.Painter.hpp"
#include "VCLTee.Editor.Grid.hpp"
#pragma package(smart_init)
#pragma link "VCLTee.Control"
#pragma link "VCLTee.Grid"
#pragma link "VCLTee.Editor.Grid"
#pragma link "Tee.GridData.Strings"
//---------------------------------------------------------------------------
#include "Tee.Grid.Totals.hpp"
TGridFooter *footer = TG_RepCateg->Footer;
TColumnTotals *totals = new TColumnTotals(footer);
totals->Calculation.Clear();
totals->Calculation.Add(TG_RepCateg->Columns->Items[i],Sum);
And this is the error message:
[bcc32 Error] Reportes.cpp(402): E2285 Could not find a match for 'TColumnTotals::TTotals::Add(TColumn *,double (_fastcall *)(const double *,const int))'
Full parser context
Reportes.cpp(274): parsing: void _fastcall TF_Reportes::QueryReporteEvolutivo(int,int,int,int,TTeeGrid *)
Could you help me?
Best regards,
Patricio Cerda
Re: Can't implement Totals using C++
Posted: Mon Jan 07, 2019 5:06 pm
by Marc
Hello Patricio,
Yes the code looks ok though it doesn't appear to be locating the correct definition for Add.
ie. in Tee.Grid.Totals.hpp
Code: Select all
void __fastcall Add(Tee::Grid::Columns::TColumn* const AColumn, const Tee::Griddata::TColumnCalculation ACalculation)
Please could you check that the debugger takes you to that definition.
Regards,
Marc