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
Can't implement Totals using C++
Re: Can't implement Totals using C++
No one has knowledge about how to use TeeGrid with C++ Builder that could help me?PCZ wrote: ↑Thu Aug 02, 2018 2:04 amHello,
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
Any help or tip would be appreciated.
Regards,
Patricio
Re: Can't implement Totals using C++
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:
The Column may be accessed by name.
Regards,
Marc Meumann
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
Regards,
Marc Meumann
Steema Support
Re: Can't implement Totals using C++
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:
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
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);
[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++
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
Please could you check that the debugger takes you to that definition.
Regards,
Marc
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)
Regards,
Marc
Steema Support