How to modify the data fields programatically ?
Can anyone help. I'm creating datasources for Fr using the following method (written with BCB6 and NexusDB)
TfrView *Query1=new TfrnxQuery();
Query1->Prop["Name"] = "MasterQuery";
Query1->Prop["Database"]="FR_Database";
Query1->Prop["SQL"]=SQL1->Text;
Query1->Prop["Active"]="true";
This works fine, but I'm not sure how to convert the query to using persistent fields once it has been added to the report. As an example, if I was using a TQuery outside of Fr I would use:
int Count=Query->FieldDefs->Count;
for(int f=0;f<Query->FieldDefs->Count;f++){
// test - only keep fields beginning with 'a'
String Name=Query->FieldDefs->Items[f]->Name;
Name.SetLength(1);
if(Name=="a" || Name=="A")
Query->FieldDefs->Items[f]->CreateField(Query);
}
How do I duplicate this functionality ? (I know I could use the data dictionary feature in this instance, but the example is for illustration only).
Many thanks for any suggestions
Des O'Toole
TfrView *Query1=new TfrnxQuery();
Query1->Prop["Name"] = "MasterQuery";
Query1->Prop["Database"]="FR_Database";
Query1->Prop["SQL"]=SQL1->Text;
Query1->Prop["Active"]="true";
This works fine, but I'm not sure how to convert the query to using persistent fields once it has been added to the report. As an example, if I was using a TQuery outside of Fr I would use:
int Count=Query->FieldDefs->Count;
for(int f=0;f<Query->FieldDefs->Count;f++){
// test - only keep fields beginning with 'a'
String Name=Query->FieldDefs->Items[f]->Name;
Name.SetLength(1);
if(Name=="a" || Name=="A")
Query->FieldDefs->Items[f]->CreateField(Query);
}
How do I duplicate this functionality ? (I know I could use the data dictionary feature in this instance, but the example is for illustration only).
Many thanks for any suggestions
Des O'Toole