Hi
I have a report which based on one company's records, and contains two subreports.
Subreport1 shows all incidents which have occured between two date ranges for this company, based on a one to many link. Incident table has companyid and dates.
Subreport2 shows all hazards and associated recommendations where the hazard has been entered in the daterange, OR the recommendation for that hazard is in the range. This is a one to many, hazards are linked to recommendations via a foreign key hazardid in recommendation table.
My problem now is that i also need to list all workzones that hazard is present in. This is held in the database as a many to many, wokzones linked to hazard via hazardworkzone junction table.
What i guess i would like to do to be able to display this info in a group after (or before) the recommendations (which are in the details section of my subreport), is to have a formula that loops through the records for this hazard's workzone and print them out at every run through hazards. can this be done? I was thinking something along the lines of:
while not eof do
first
if hazardworkzone.hazardid = hazard.hazardid then
{workzone.workzonename}
next
is this possible, even practacle? I know i cant nest subreports and cant think of another way to do this.
I have a report which based on one company's records, and contains two subreports.
Subreport1 shows all incidents which have occured between two date ranges for this company, based on a one to many link. Incident table has companyid and dates.
Subreport2 shows all hazards and associated recommendations where the hazard has been entered in the daterange, OR the recommendation for that hazard is in the range. This is a one to many, hazards are linked to recommendations via a foreign key hazardid in recommendation table.
My problem now is that i also need to list all workzones that hazard is present in. This is held in the database as a many to many, wokzones linked to hazard via hazardworkzone junction table.
What i guess i would like to do to be able to display this info in a group after (or before) the recommendations (which are in the details section of my subreport), is to have a formula that loops through the records for this hazard's workzone and print them out at every run through hazards. can this be done? I was thinking something along the lines of:
while not eof do
first
if hazardworkzone.hazardid = hazard.hazardid then
{workzone.workzonename}
next
is this possible, even practacle? I know i cant nest subreports and cant think of another way to do this.