Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Report grouping question Post Reply Post New Topic
Author Message
ckhan84
Newbie
Newbie


Joined: 30 Dec 2015
Online Status: Offline
Posts: 7
Quote ckhan84 Replybullet Topic: Report grouping question
    Posted: 13 Jan 2016 at 9:54am
Hi All,

I have a question relating to an issue I am having that is definitely related to grouping.  Sadly, I do not know how to accomplish what I need to do as adding groups to my report sadly seems to be causing the issue.

I am working basically from three tables - Contract, ContractParticipant, and ContractComment.  Contract has a LEFT OUTER JOIN relationship to the other two tables based on the Contract#.  ContractComment and ContractParticipant have no relation and need to display their data separately which is why I have been trying to display their results in separate groups.  Both tables can have multiple values/entries saved to the table for every Contract.

What I am trying to achieve is to display the reports in this way...

1. CONTRACT and all relevant fields
2. All data from CONTRACTPARTICIPANT
3. All data from CONTRACTCOMMENT

So the data might look something like this...

"Contract:
15003

Participants:
150
200
300

Comments:
Notes 1...
Notes 2...
Notes 3..."

So my grouping looks like this:
Group Header 1 - Contract fields
Group Header 2 - Participant fields
Group Header 3 - Comment fields

They do have a specific sort order but I basically get an output where I receive one participant followed by one comment followed by another participant followed by another comment, etc.  How am I supposed to group and sort different tables so that one table displays all of its data... followed by another group that displayed all of the data from that table.  Again, these two tables have no relationship and I just need all of the data to display separately.  How can I achieve this?

Thank you, everyone.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jan 2016 at 10:07am
if you do not have a lot of contracts and you do not need to summarize any data from the detail tables consider two sub reports to display each set of details
IP IP Logged
ckhan84
Newbie
Newbie


Joined: 30 Dec 2015
Online Status: Offline
Posts: 7
Quote ckhan84 Replybullet Posted: 13 Jan 2016 at 10:43am
Originally posted by DBlank

if you do not have a lot of contracts and you do not need to summarize any data from the detail tables consider two sub reports to display each set of details


I have never worked much with sub-reports and wouldn't expect anyone to teach me everything here... do you know of any particular guide online that might be able to help me build a subreport?  I was reading around and it did sound like this might be the way I need to do this...

Thank you! 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jan 2016 at 10:49am
remove your extra tables from the main report
place your contract and relevant fields in the detail section
insert a details b and details c
insert a sub report into the main report on details b
use the participant table as the data source
right click and link it on the contract #
edit the sub report like you would any other report.
repeat for the comments

each sub report will run once per detail row in the main report
the linking process bascially passes the current detail value of contract ID as a parameter into the sub report and that becomes a select filter in that sub report (?pm-contractId = table.contractid)

You can also search this site on 'linking sub reports'
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.000 seconds.