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

sub reports and variables

Status
Not open for further replies.

azzyesp

Programmer
Jul 9, 2010
1
GB
Im trying to determine which users have not submitted a time sheet on my database for a given week.

Basically the database tables holds timesheet details against individuals that have submitted timesheets. So you can have 1 user that has submitted for 5th July til 11th and another 28th June til 4th July.

Problem is the database only holds the weeks against users that have submitted timesheets.

What im trying to do is produce a main report that list all the people that have sent a timesheet in for a week, i then created a subreport listing all the users on the system.

Im trying to use shared variables to pull back all the users from the subreport and only show the ones that dont exist in the main report

So i've basically created the following formulas.
1. Subreport in details - (to initialise variable)
Shared NumberVar Users;
Users := {users.user_id};

2. subreport report header (to reset variable)
Shared NumberVar Users;
Users := 0;

3. Main report in details
Shared NumberVar Users;
Users;

I have placed the subreport in a group called user_id. I have not created any links between the sub report and main report so i can see all the users. The problem i am having is that the variables that i use to display shows me 0 all the time.

Help?
 
You should make the list of employees the main report and add the table with timesheet details as the subreport, since subreports act like they are left outer joined. You would place the sub in a main repoort group based on employeeID and then link the sub to the main report on the id field.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top