How to Speed up DesignReport() call
First off, if you have any better solutions than what I'm doing, I am all ears.
I have a setup as follows:
Files->Tables->Data Objects
It's not a true database, but I want the users to be able to access the data as though it were one. So what I have done is create a UserDataSet for each Table, and populated it with a list of all the relevant Data objects. As well, while I want them to have access to all the Tables at all times, some setups will have more and less relevant Tables allowed. In those cases, I want to auto-populate the data-tree structure on the right hand side of the designer with the "expected most relevant tables."
The pseudo-code is as follows:
CustomReport->EnabledDataSets->BeginUpdate();
CustomReport->DataSets->BeginUpdate();
For all Tables:
TfrxUserDataSet* DS = new TfrxUserDataSet(this);
DS->Visible = true;
DS->Enabled = true;
For All Data Objects:
DS->Fields->AddObject( "Label", (TObject*) ftInteger (or relevant));
CustomReport->EnabledDataSets->Add( DS );
if (DS is expected to be used)
CustomReport->DataSets->Add(DS);
CustomReport->EnabledDataSets->EndUpdate();
CustomReport->DataSets->EndUpdate();
CustomReport->DesignReport(false);
CustomReport->Designer->UpdateDataTree();
However, with this setup, the command "CustomReport->DesignReport(false);" can take about 10 seconds to execute, even on a completely blank form. I was wondering what I could do to speed that up?
---
P.S. : DS->Fields->AddObject( "Label", (TObject*) ftInteger (or relevant)); doesn't seem to indicate to the designer what type of data object the field is. The designer always has the ".0" symbol. Is there a way to flag the type of data object between integer, float, and string?
I have a setup as follows:
Files->Tables->Data Objects
It's not a true database, but I want the users to be able to access the data as though it were one. So what I have done is create a UserDataSet for each Table, and populated it with a list of all the relevant Data objects. As well, while I want them to have access to all the Tables at all times, some setups will have more and less relevant Tables allowed. In those cases, I want to auto-populate the data-tree structure on the right hand side of the designer with the "expected most relevant tables."
The pseudo-code is as follows:
CustomReport->EnabledDataSets->BeginUpdate();
CustomReport->DataSets->BeginUpdate();
For all Tables:
TfrxUserDataSet* DS = new TfrxUserDataSet(this);
DS->Visible = true;
DS->Enabled = true;
For All Data Objects:
DS->Fields->AddObject( "Label", (TObject*) ftInteger (or relevant));
CustomReport->EnabledDataSets->Add( DS );
if (DS is expected to be used)
CustomReport->DataSets->Add(DS);
CustomReport->EnabledDataSets->EndUpdate();
CustomReport->DataSets->EndUpdate();
CustomReport->DesignReport(false);
CustomReport->Designer->UpdateDataTree();
However, with this setup, the command "CustomReport->DesignReport(false);" can take about 10 seconds to execute, even on a completely blank form. I was wondering what I could do to speed that up?
---
P.S. : DS->Fields->AddObject( "Label", (TObject*) ftInteger (or relevant)); doesn't seem to indicate to the designer what type of data object the field is. The designer always has the ".0" symbol. Is there a way to flag the type of data object between integer, float, and string?
Comments
to disable loading of field names in the FR Designer