How to make fields visible/invisib for one record
Hello group .
I am in soup again .. .
In my report I am adding all the fields dynamically to the master data band.
Like Account : [AccountNo] | BankName : [BankName] |..........etc
However I have 3-15 fields say Field1 to Field15 which I add to master data
band during formatting and before preparing report.
These Field1 to Field15 properties are not valid all the time. That is depending
upon the some other field. So I have written some code to populate these fields
in "OnFirst" and "OnNext" events of TfrDbDataset. In this event I calculate and
find out which of these Field1 to Field15 are valid. And I populate a list with the
valid values and those fields that are not valid I set there visible property to
false.
Now in the OnGetValue Method of the report I have a code like this
FrReport.GetValue (ParName,ParValue);
begin
FldIdx := DBFldNames.IndexOf(ParName);
if FldIdx > -1 then
begin
ParValue := DBValues.Strings[FldIdx];
end
end;
This works fine when I have all the fields(Field1 to Field15) valid.
But gives problem when some of the fields are visible =false;
My question is if a I make a field12 (whose text is [Field12]) invisble why does OnGetvalue event fire with ParName = Field12 (even though that
field is invisible.)?
How can make some fields invisible and corresponding OnGetValue fn doesn't fire for those invisible fields.. ?
Thanks in advance
Amar
I am in soup again .. .
In my report I am adding all the fields dynamically to the master data band.
Like Account : [AccountNo] | BankName : [BankName] |..........etc
However I have 3-15 fields say Field1 to Field15 which I add to master data
band during formatting and before preparing report.
These Field1 to Field15 properties are not valid all the time. That is depending
upon the some other field. So I have written some code to populate these fields
in "OnFirst" and "OnNext" events of TfrDbDataset. In this event I calculate and
find out which of these Field1 to Field15 are valid. And I populate a list with the
valid values and those fields that are not valid I set there visible property to
false.
Now in the OnGetValue Method of the report I have a code like this
FrReport.GetValue (ParName,ParValue);
begin
FldIdx := DBFldNames.IndexOf(ParName);
if FldIdx > -1 then
begin
ParValue := DBValues.Strings[FldIdx];
end
end;
This works fine when I have all the fields(Field1 to Field15) valid.
But gives problem when some of the fields are visible =false;
My question is if a I make a field12 (whose text is [Field12]) invisble why does OnGetvalue event fire with ParName = Field12 (even though that
field is invisible.)?
How can make some fields invisible and corresponding OnGetValue fn doesn't fire for those invisible fields.. ?
Thanks in advance
Amar