|
Technical answers from the trenches |
|
Passing Values to Reports
| ||||
Posted: 17 June 2003 |
||||
  |
Applies to: Paradox 5.0 and later |
|||
  |
Audience: Beginner |
|||
Question: How do I pass values to reports so they can be printed with the report?Answer: There are several ways to do this, but the easiest that we've found involves a two-step process:
When you do this, remember that readEnvironmentString() returns an empty string if the variable doesn't exist. Because of this, it's best to include the IIF() in your calculation to provide a value if the variable doesn't exist when the report is run. As an example, consider the following calculation that we've used in a production application: iif( readEnvironmentString( "RPTTITLE" ) <> "",
readEnvironmentString( "RPTTITLE" ),
"<RPTTITLE was not defined>" )This calculation calls readEnvironmentString() twice: once to make sure the value is defined and once to return the value from the environment. Note: The above calculation is split across multiple lines for readability; Paradox does not let you (easily) use multi-line calculations in calculated fields. For additional ideas and approaches, please see Mike Irwin's FAQ on the subject. |
|||
|
||||||||
|
Copyright © 2000-2004, techtricks.com; All Rights Reserved. Acknowledgements, Disclaimers, Terms and Conditions. |
||||||||
|
Article last updated on 16 June 2003
|
||
|
|
||
|
[- End -]
|