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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report names as a variable

Status
Not open for further replies.

Jerim65

Technical User
Aug 8, 2010
99
AU
I have a number of report forms in my app.

I have a routine to show the report ( with Page n of n footer) with a few bells and whistles.

I was copying the original *.fr* to my temp folder as myreport.*. then calling the common code.

This used to work but does not now.

As an alternative can I consign the actual report form name to a variable - myreport and then use this in my common print statement.

report form myreport etc

Regards

Coldan
 
What does not work anymore with your old approach? Copy the frx/frt files to GetEnv("TEMP") hould always work.

Otherwise you can set a variable and use name expression:
lcReport = "myreport.frx"

REPORT FORM (lcReport) etc.

This makes VFP use the value of lcReport rather than to look for a file named lcReport.frx.

Bye, Olaf.
 
Coldan,

For what it's worth, I usually do what you are suggesting.

I have a generic report launch form. One of its properties is cReportName, which holds the FRX filename. In the "Print now" button, I do REPORT FORM (thisform.cReportName) TO PRINTER PROMPT.

This works for me, and I'm sure it will work for you.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top