Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I add PAL variables to reports 1

Status
Not open for further replies.

paulvos

Technical User
Aug 1, 2001
8
NL
I would like to add the answer to a form input as a title to my report (so not a field from a table)
If this is possible, how should I proceed?
 
Check out the writeEnvironmentString method. Use it and a calculated field (with readEnvironmentString) in the report.

Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
Dear Mac,

Thanks for taking the trouble to answer me. Your reply shows me I have been unclear about what I want. I don't want to name the report from DOS, but I want to put a title at the top of the report using a variable.

Can this be done?
 
I dont think you can directly link the variable from code to the report. What I would do (and this is me), is I would add the value from variable to a table and then link the field in the report to the filed in the table.

But once again that's just me, and there should be a easier way.

 
No Paul, you were clear. I was assuming you clicked a button or something to generate the report. In the button code before the call for the report simply add the line:

writeEnvironmentString("myVar",ReportTitleVar)

Where "myVar" (quotes required) is the environment variable you are creating, and ReportTitleVar is a string variable to which you assign the return value from your title naming form. Don't forget to declare ReportTitleVar in your var/endvar statement.

In your report design, add an unbound field where you want the title. Right-click the field and choose 'define field'. When the dialog box opens, check the 'calculated field' box and put this code in the calculation blank:

readEnvironmentString("myVar")

When you run the report using your code, the report title appears. If you do it manually using QBE there will be no title since the ReportTitleVar variable is never assigned.

Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top