Board index » cppbuilder » QuickReport 2: TQRGroup pointer not available to set it programmatically

QuickReport 2: TQRGroup pointer not available to set it programmatically


2005-03-13 02:44:49 PM
cppbuilder43
Hello,
This is a QuickReport question. I wonder why there isn't a group for it or even a general C++ Builder database newsgroup (Delphi does).
Anyway, I have a TQRGroup in a report but cannot change it programmatically because there is no pointer data member for it in the form's class, even though there are data members with the pointers for its footer band.
I searched the Usenet and someone had fixed this problem by adding the pointer manually to the class' header file. I tried that and got an illegal access exception (which makes sense since the pointer was not initialized).
Has anyone have encountered this or know how to fix it?
Best,
Rodrigo
 
 

Re:QuickReport 2: TQRGroup pointer not available to set it programmatically

For the record, I worked around this bug by accessing the BandList property of the report. I go through it until I find a band with the name of the TQRGroup band I want to access:
TQRGroup* Group0;
TList *bands = Report->BandList;
for (int i = 0; i != bands->Count; i++)
{
void *band = bands->Items[i];
if (band != NULL &&
static_cast<TComponent*>(band)->Name == "Group0")
{
GroupPtr = static_cast<TQRGroup*>(band);
break;
}
}
Best,
Rodrigo