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

Global Variables: How to use them in Cross Tab?

Status
Not open for further replies.

bidra

Programmer
Feb 28, 2002
31
0
0
DE
CR 8.5 or 10

Hello,

I've got a problem receiving the correct value from a global variable in a cross tab formula.

The cross tab is defined in report header.
The global variable are to prevent double countings under certain conditions.
The code for the formula goes like this:

--------------------------
WhileReadingRecords
Global MultNum as number
Global MultKey as number

formula = 0

If MultNum <> {TAB1.ATNUM} Then
MultNum = {TAB1.ATNUM}
MultKey = 0
End If

If ({TAB1.LP} = 1621 Then
MultKey = MultKey + 1
End If

If ({TAB1.LP} = 1621
if MultKey < 2 then
formula = + 1
end if
else
formula = + 1
end if
--------------------------

The formula results show that global variable are not set and changed properly, eg. 2 instead of 1 .

Did I use the global variable not correctly or is there missing something else ?

Many thanx in advance

bidra
 
Have mangaged to create the shared variable

Whileprintingrecords;
Shared currencyvar shddata_SellingPrice := Sum ({@Selling Price}, {Command.RRE_Code});

But now cannot read the value into my other sub report. getting 0:00. Any ideas?

thanks in adv.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top