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

Variables not passing values

Status
Not open for further replies.

LMGroup

MIS
Apr 10, 2006
85
CA
I'm using CR 12 with a SQL Server 2005 database. I'm using a subreport to calculate values and pass the report footer back to the main report. Each job can have an unlimited number of status codes assigned to it. If one of 4 are used, the different variables are supposed to change to indicate that a particular status has been entered.

I'm resetting the variables in the Report Header (this seems to be working):
Code:
Global stringvar proof:="No";
Global stringvar plate:="No";
Global stringvar stock:="No";

proof & "    " & plate & "    " & stock

I'm calculating the values in the Details section (this is working):
Code:
Global stringvar proof;
Global stringvar plate;
Global stringvar stock;

WhilePrintingRecords;

if {JobStatus1.StatusCode}=11399 then proof:="Yes";
if {JobStatus1.StatusCode}=13549 then plate:="Yes";
if ({JobStatus1.StatusCode}=11699 or {JobStatus1.StatusCode}=11799) then stock:="Yes";
proof & "    " & plate & "    " & stock

I'm supposed to be printing the values in the Report Footer, but it just gives me the same values as the Header instead of the Details section:
Code:
Global stringvar proof;
Global stringvar plate;
Global stringvar stock;

proof & "            " & plate & "          " & stock

Once I get the Report Footer values correct, I'll be hiding the first 2 sections and just returning the final line to the main report.

Thanks for your help.
 
I got it working. Forgot the WhilePrintingRecords; line in the 3rd formula.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top