In this example i am going to describe how to Create SubReports in Crystal Reports or Crystal Reports SubReport in ASP.NET Using C# And VB.NET. For this i have used two tables from MS SQL database named Employees and Projects.
Main Crystal Report is fetching data from both the tables and is grouped by Project Name
SubReport is used to display information about respective project and fetching data from Projects Table.
Schema for both the tables in shown below in images, create tables accordingly and add relevant data in it to start.
On default.aspx page drag CrystalReportViewer from toolbox and assign CrystalReport we just created as source
Html source will go like this (AutoGenerated)
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True" Height="1039px" ReportSourceID="CrystalReportSource1" Width="901px" /> <CR:CrystalReportSource ID="CrystalReportSource1" runat="server"> <Report FileName="CrystalReport.rpt"> </Report> </CR:CrystalReportSource>
Save, build and run the solution , this is how Crystal Report SubReport will look like
Hope this helps.