ibbm


I have programs that set variables for certain fields to print on reports. How do I pass variables to these without making them public

My program is something simple like this:

declare variables as public

set variables depending on the user selections

select table.*

from table

INTO CURSOR Confirm
CREATE REPORT rname.frx FROM Confirm WIDTH 640 COLUMN NOOVERWRITE
REPORT FORM rname TO PRINTER NOCONSOLE

in the form rname I use the print when clauses to print certain things based on whether the variable is true or false.

Thanks in advance




Re: passing variables to reports without declaring them as public.

MarciaAkins


ibbm wrote:

I have programs that set variables for certain fields to print on reports. How do I pass variables to these without making them public

You can eoither make them PRIVATE or you can make them form properties. The report can "see" the properties of the form it was called from - just use Thisform.Whatever as the expression to print it on the report.







Re: passing variables to reports without declaring them as public.

Naomi Nosonovsky

Report sees LOCAL variables just fine. It also sees thisform properties and methods, so you can have

local lcTitle

lcTitle = 'My Title'

report form myReport preview

and use lcTitle in the report.

You can also have

thisform.MyMethod() which returns preformatted string

and use thisform.MyMethod() in the report.

We discussed this topic here few times, try to search on 'local report'






Re: passing variables to reports without declaring them as public.

CetinBasoz

"Report" is a command. That means report has access to all variables, objects that the routine called the "report" have access to (local, private ... thisform etc)