How can I specify which field to take the data from depending on the value of another field
Hi
I am just trying out fast reports using Delphi 7 and was wondering if it is possible to specify which field in a table to take the data from depending on the value of another field.
For example
I have created a basic report with 3 output fields on it. Name, Description, Avalue
I connect it to a database table etc, What I want to do is when the report is shown to be able to look at another field in the database table and check the value of it, if the value is true put contents of one of the table fields into the Avalue report field if False put another fileds contents into the AValue report field.
Like -
IF (table1.fieldbyname('fieldA').asbool then
report field := table1.fieldbyname('fieldB').asString
else
report field := table1.fieldbyname('fieldC').asString;
I hope this makes some sort of sense
Any help would be greatfully received
Meee
I am just trying out fast reports using Delphi 7 and was wondering if it is possible to specify which field in a table to take the data from depending on the value of another field.
For example
I have created a basic report with 3 output fields on it. Name, Description, Avalue
I connect it to a database table etc, What I want to do is when the report is shown to be able to look at another field in the database table and check the value of it, if the value is true put contents of one of the table fields into the Avalue report field if False put another fileds contents into the AValue report field.
Like -
IF (table1.fieldbyname('fieldA').asbool then
report field := table1.fieldbyname('fieldB').asString
else
report field := table1.fieldbyname('fieldC').asString;
I hope this makes some sort of sense
Any help would be greatfully received
Meee
Comments
ie
if <datasetname."fieldname"> = True then memo1.text := '[datasetname."fieldname1"]' else memo1.text := '[datsetname."Fieldname2"]';
Also one more thing I need to access some varibles from inside the report events that are stored in another form in the project, could you tell me where I would put the uses clause to in the script
thanks
meee
frxReport1.Script.AddForm(Form2);
in TfrxMemoView
[Form2.Edit1.Text]
Thanks