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

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.