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

help needed with respect to global or shared variables 1

Status
Not open for further replies.

44veena

Technical User
Jun 24, 2002
15
US
Hi all,
My report deals with forecasting values for the next year. the report will forecast the price value of 7 products. now all the coding is the same for all the fields, except that the product field will change for every field. now i want to use only one formula, and have variables , so that i can change only the respective variables in each field and keep the rest of the formula same.
for eg: if product = scanner then blabla bla..in the next row...say product = engines..bla bla bla..its a pretty long code , so i want to use a global or a shared variable say "prod" and check for every field . but that does not work. for some reasons i am not able to pass the variables. the values are the same in each field.
 
If {product} is a field in your data record, or if it can be calculated based on other data fields, you can use that field in your formula and place the formula field on the detail line.
 
Shared variables are ONLY used to pass values between a subreport and main report....you don't seem to have a subreport here so then you don't use them in this case.

to pass variables among formulas I think you could declare them Global at the beginning of the report in a formula and forget about them after that.

I don't like doing this though since a week or 3 later when doing maintenance you forget about how those variables were defined.

If in every formula you declare the variable type simply by something like

Numbervar x;
Stringvar y;

then it is easy to maintain...IMHO Jim Broadbent
 
thank you ngolem, i guess this should work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top