Search code examples
c#-4.0crystal-reportsrowsubreport

Subreport for each row of Main Report in Crystal Report


I have a main report which displays Applicant and its details and I want to show the Notes related to that Applicant as a sub report, so If I have around 100 Applicants then for each row of Applicant, I want to show the details under it as a sub report. Is it possible to have a sub report for each row? I mean I am not able to get how from my sub report which has notes for all Applicants, I will be showing records filtered for each Applicant that too below each related Applicants row.

ApplicantName1    Address1   City1     Salary1

Notes:
Date1  Initials1      AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Date2  Initials2     BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

ApplicantName2    Address2   City2     Salary2

Notes:
Date3  Initials3      AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Date4  Initials4      BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

I have created a sub report which shows notes for all(that is done), now how to show sub report data only related to first row? Do I have to pass a parameter, by placing the report in the details section? Kindly guide me and I am searching for all.


Solution

  • You have to insert your sub report in the 'Details' section itself, under the fields. You might preferably want to turn off all headers/ footers in your sub report, and would have to play with the height of sections of main and sub report before you get them perfect.

    Yes, Parameter is needed to link the two, the concept is more like linking a master/child table. not at all complex. In your case, ApplicantID could be the link key to the sub report