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

Shared Variable for first/second/third record

Status
Not open for further replies.

DJWheezyWeez

Technical User
Jun 5, 2008
265
US
I'm using CR XI.

I have a report listing machine parts used on a single job. Sometimes it's one, sometimes it's more than one. When there's two parts used, I've been able to work with max/min to create variables for each part, but I'm having trouble figuring out a way to create a variable for each part when there's more than two.

I've created three subreports, each showing the 1st, 2nd, and 3rd record by suppressing the others rather than excluding them via record selection. While I can see and display each part on the report and the detail for each part (sizes/types/etc), when I create a shared variable, it displays the 3rd record in each subreport. I expected this to happen but it was worth a shot.

Is there a way to create something like shared numbervar Size1 := size of the first part, shared numbervar Size2 := size of the second part, and shared numbervar Size3 := size of the third part, either one variable in each subreport or a way to combine everything into one subreport?

Any help or ideas are appreciated.
 
Where are the subreports located and how are they linked? Try placing only one subreport in the detail section and link it to the main report on part number.

If you need some value from the sub to use in the main report, you can add a shared variable, but it would help to know what you are trying to do with these value(s).

-LB
 
The three subreports are in the detail section of the report. On this report, jobs have items and items have parts. I'm linking on the item to the main report. The purpose of creating variables here is to check the job is being estimated correctly compared to what parts we're using. For example, if the part is specified to have 4 across and 4 around (think LxW), and the job is estimated to have an area of 15, since 4x4=16 and 16<>15, either the job is estimated incorrectly or we're using the wrong part. The problem is not every part has this 4x4 when there are multiple parts since different parts do different things.
 
If you link on the item and the part, you will see the detail you need to pass to the main report.

-LB
 
Part does not exist on the main report, only in the subreport.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top