Advice on how to display a calculated field please?
Please can somebody advise me as I'm not completely clear on the documentation.
I have a simple banded report containing six text boxes on each row that display numeric data from a database.
I want to add a seventh text box to display a string whose value depends upon the other six items on that row.
I can do the logic and have prototyped a function to give me the correct string. What I don't know however is...
1) How do I refer to the data in the boxes - what syntax do I use and do I use the db field names or the report's text object names?
2) Where exactly should I write my function?
3) How do I get the seventh text box to refer to the function so as to display the result of my function?
I'd be very grateful if somebody could help me out with a simple example
eg
if textbox1 contains field1 from data set dsMain and textbox2 contains field2 from dataset dsMain, how would I make textbox3 display 'yes' if the contents of textbox2 is greater than the contents of textbox1 and 'no' otherwise?
Howard
I have a simple banded report containing six text boxes on each row that display numeric data from a database.
I want to add a seventh text box to display a string whose value depends upon the other six items on that row.
I can do the logic and have prototyped a function to give me the correct string. What I don't know however is...
1) How do I refer to the data in the boxes - what syntax do I use and do I use the db field names or the report's text object names?
2) Where exactly should I write my function?
3) How do I get the seventh text box to refer to the function so as to display the result of my function?
I'd be very grateful if somebody could help me out with a simple example
eg
if textbox1 contains field1 from data set dsMain and textbox2 contains field2 from dataset dsMain, how would I make textbox3 display 'yes' if the contents of textbox2 is greater than the contents of textbox1 and 'no' otherwise?
Howard
Comments
[iif((<datasetname."fieldname2">) > (<datasetname."fieldname1">),'Yes', 'No')]
Ah, thank you, I was trying to do it all in Pascal, putting the function in the 'code' part.
I also didn't appreciate I had to use sql type syntax.
Thanks for clarifying how you refer to things as well, I was getting a bit confused between the field name and the name of the textobject.
I'll give it a go, extrapolated up to six objects.
Howard