Hello,
I have a newbie question regarding subreports in Crystal Reports 8.5. I'm used to Access, but my boss insists that I use Crystal Reports for my current project.
Anyways, everything in my Crystal Reports report is fine, except that my subreport is not linking to all the records in the main report.
In my main report, the records grouped by "Project" and lists the Tasks associated with that Project and summary info for these Tasks. I have arranged it so that each Project has its own page (new page after the Project footer). This part is fine.
The Project group footer contains a subreport that is based on a separate table. This subreport is supposed to show the people involved in each task and their associated data.
My goal is to have the main report data (Task data) show up together in one section the upper portion of the report and the subreport show up in one section in the lower part of the report. So I want it to look like this:
------------------------------------------- (start of page -- main report)
Project A
Task Estimate Actual
---- -------- ------
Task A 100 250
Task B 200 100
Task C 300 300
Proj A totals xyz xyz
------------------------------------------- (subreport)
Task A
People Hours Pay
------ ----- ---
Person 1 40 100
Person 2 35 250
A subtotals xy xyz
Task B
People Hours Pay
------ ----- ---
Person 4 50 150
Person 6 25 125
B subtotals xy xyz
Task C
People Hours Pay
------ ----- ---
Person 7 45 100
Person 9 40 175
C subtotals xy xyz
Proj A totals xy xyz
------------------------------------------- (end of subreport -- end of page)
However, as it stands, the subreport doesn't show all the Tasks. It shows only the last Task (Task C in this example). I have the subreport linked to the main report by Task, although I also have a Project field available in the subreport data to link on as well.
The way I see it is that when I link by Task number, only the last Task "read" in the main report is used to grab the subreport data, so I only get People info for the last Task.
If I link the subreport to the main report by Project instead of by Task, the subreport shows all the Tasks, but also shows items that shouldn't show up. Don't ask me why this is--I have no control over the data. Apparently, the subreport data contains items that don't show up in the main report data, so it shouldn't show up in the subreport either. If not for this quirk in the subreport data, I think I'd able to link on the Project field instead of the Task field and everything would be fine.
I've also tried linking the subreport by Project and then using a secondary link to Task, but that still results in only the last Task showing up. I'm trying to figure out if it is possible to use an array to store the Task numbers in the main report and then use that as a filter for the subreport.
If I add a Task group to the main report and place the subreport in the Task group footer, the subreport shows all the revelant Tasks, but separately following each Task, not in one "summary" section at the bottom of the page. So instead of a Task summary section and People summary section, I get three separate Task-People sections, which is not what I want.
I'm beginning to think a subreport can only link to fields (parameters?) that consist of one value and not multiple values (like I'm trying to do--having the subreport link to Tasks A, B, and C). I hope I'm wrong about this though...
Is there a simple way to get the subreport data I want in the form I want?
Thanks for any advice.
I have a newbie question regarding subreports in Crystal Reports 8.5. I'm used to Access, but my boss insists that I use Crystal Reports for my current project.
Anyways, everything in my Crystal Reports report is fine, except that my subreport is not linking to all the records in the main report.
In my main report, the records grouped by "Project" and lists the Tasks associated with that Project and summary info for these Tasks. I have arranged it so that each Project has its own page (new page after the Project footer). This part is fine.
The Project group footer contains a subreport that is based on a separate table. This subreport is supposed to show the people involved in each task and their associated data.
My goal is to have the main report data (Task data) show up together in one section the upper portion of the report and the subreport show up in one section in the lower part of the report. So I want it to look like this:
------------------------------------------- (start of page -- main report)
Project A
Task Estimate Actual
---- -------- ------
Task A 100 250
Task B 200 100
Task C 300 300
Proj A totals xyz xyz
------------------------------------------- (subreport)
Task A
People Hours Pay
------ ----- ---
Person 1 40 100
Person 2 35 250
A subtotals xy xyz
Task B
People Hours Pay
------ ----- ---
Person 4 50 150
Person 6 25 125
B subtotals xy xyz
Task C
People Hours Pay
------ ----- ---
Person 7 45 100
Person 9 40 175
C subtotals xy xyz
Proj A totals xy xyz
------------------------------------------- (end of subreport -- end of page)
However, as it stands, the subreport doesn't show all the Tasks. It shows only the last Task (Task C in this example). I have the subreport linked to the main report by Task, although I also have a Project field available in the subreport data to link on as well.
The way I see it is that when I link by Task number, only the last Task "read" in the main report is used to grab the subreport data, so I only get People info for the last Task.
If I link the subreport to the main report by Project instead of by Task, the subreport shows all the Tasks, but also shows items that shouldn't show up. Don't ask me why this is--I have no control over the data. Apparently, the subreport data contains items that don't show up in the main report data, so it shouldn't show up in the subreport either. If not for this quirk in the subreport data, I think I'd able to link on the Project field instead of the Task field and everything would be fine.
I've also tried linking the subreport by Project and then using a secondary link to Task, but that still results in only the last Task showing up. I'm trying to figure out if it is possible to use an array to store the Task numbers in the main report and then use that as a filter for the subreport.
If I add a Task group to the main report and place the subreport in the Task group footer, the subreport shows all the revelant Tasks, but separately following each Task, not in one "summary" section at the bottom of the page. So instead of a Task summary section and People summary section, I get three separate Task-People sections, which is not what I want.
I'm beginning to think a subreport can only link to fields (parameters?) that consist of one value and not multiple values (like I'm trying to do--having the subreport link to Tasks A, B, and C). I hope I'm wrong about this though...
Is there a simple way to get the subreport data I want in the form I want?
Thanks for any advice.