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

Shared Variable in Subreport Showing as False Instead of Actual Value 1

Status
Not open for further replies.

strider1973

Programmer
Nov 6, 2001
4
US
I am working in Crystal 8.5. I have a subreport that I am listing the types of charges for a particular meeting that the report is based on. For example, the subreport would show:

Room and Tax: Master
Food and Bev: Master
Incidentals: Individual
etc...

I want to pull the result for Room and Tax, in this case "Master", and work with it on the main report. I do not need this same value for any other category. In the subreport I created a formula field like so:

WhilePrintingRecords;
Shared NumberVar HotelBillOpt;
If {BillCategory.BillCatName} = "Room & Tax" then
HotelBillOpt = {BillCategory.BillCatNum}

Where the BillCatNum will be 1 or 2 representing Master or Individula. When I run the report the shared variable will show False or true instead of the 1 or 2. What am I doing wrong here?

Thanks,
S
 
Try Changing it to:

WhilePrintingRecords;
Shared NumberVar HotelBillOpt;
If {BillCategory.BillCatName} = "Room & Tax" then
HotelBillOpt := {BillCategory.BillCatNum}
else
HotelBillOpt := 0;
HotelBillOpt

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top