Click here to Skip to main content
15,891,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Problem : I am using a crystal report which contain One main report and one subreport

each main record contain some basic data and have group data in subreport.
Hoe to set codes for above solution.

for Example : a company wants to show basic record for all employees as well as month wise annual report for each employee as subreport

I use following code to a simple crystal report

VB
dim CrReport as New CRmain

crMain.SetDataSource(DTable)

RptViewr1.Reportsource = CrReport

RptViewr1.refresh()
Posted
Updated 19-Sep-11 11:27am
v2

this way...
VB
   Dim orpt As New ReportDocument
...
   orpt.Subreports("HeaderRpt.rpt").SetDataSource(HeaderDT)

Happy Coding!
:)
 
Share this answer
 
You need to set up datasource for the sub report too. Here it is, read the "Sub report" section: Working with Crystal Reports in .Net[^]
 
Share this answer
 
VB
dim CrReport as New CRmain
 
CrReport.SetDataSource(DTable)
 
RptViewr1.Reportsource = CrReport
 
RptViewr1.refresh()
 
Share this answer
 
Here is a simple program that create a subreport.........Crystal Report Sub report

Hope it will help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900