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.
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:
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"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.