that is interesting I just read that post about the Control R deleting the text and now it happened to me by accident... I will go type it in WORD first then repost it so I dont lose it. Cordell
I am having trouble understanding sub reports. I looked in search and cannot find anything like this question.
I have a report where each school employee has hours on from 1 to 3 different assignments and I have to find which assignment has the largest total hours then use the number of days worked from that largest total assignment times the hours for all 3 assignments (don’t ask... it is a union thing).
I created a sub report to display the assignments. That worked
I put the largest total hours worked in a shared variable and that worked
Then I multiplied the total days worked by that shared variable from the largest one on the main report.
However just like you say in the book on page 374, the total is off by one assignment every time.
So I wrote a simpler report just to test it.
The Main report has one table called ZipCode.
I put the field ZipCode.Zip-Code on the main report in the detail section.
Then I created a matching sub report with that one table and linked by ZipCode.Zip-Code.
Then I created a formula in the sub report called fmsubZipCodeState
shared stringvar ZipCodeState;
ZipCodeState := ZipCode.Zip-State;
I put the sub report on the main report in the detail section next to the ZipCode.Zip-Code field
Then I created a formula in the main report called fmmainZipCodeState
Shared stringvar ZipCodeState;
ZipCodeState;
and put it on the main report to the right of the sub report
Now on the main report detail line I have table field ZipCode.Zip-Code, the sub report (showing the 2 digit state from the sub report) and then the formula from the main report fmmainZipCodeState (showing the 2 digit state from the main report)
My results
09045 AL
71823 AR AL
85004 AZ AR
What am I missing here? I tried putting the sub report and the main report formula in the header, in the footer, in the detail… I have put so many combinations of the sub report and those two fields in the headers, footers, detail, their own header their own footer that I am dizzy and it is still always one calculation off.
Can you help me see through the fog? This should be so simple it should be stupid to even ask but I can’t make it work. If I can get the zip code report to work I should be able to use the logic from that to make my school employee calculation report work (hopefully…. if I can understand arrays)….
Cordell