Crystal Report and Subreport
How to link two tables in Subreport
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Prabhu RajaPosted Oct 10, 2011, 2:44 AM
I have Replied to a Thread regarding linking Two Tables in Crystal Report, You may try this.
http://www.c-sharpcorner.com/Forums/Thread/138772/problem-with-linking-two-tables-in-crystalreport.aspx
Hemant KumarPosted Oct 10, 2011, 1:02 AM
As far as I can tell, it is impossible to nest one dataset inside of another one without using a subreport.
This means you need to do one of two things:
Refactor your two datasources into a single datasource. For example, perform a join between the employees and the working hours for each employee. You can then use the grouping properties of the Table object to format the list the way you want it.
If joining the two data sources is not practical, you can use subreports to accomplish what you want. Create a subreport containing the working hours data source and give it a parameter for the current employee. Filter the working hours by this parameter.
In your parent report, you can place the subreport in the list, and pass the employee ID for the current row as a parameter.
Note that there are a few formatting quirks involved with using subreports. I've been able to work around them in most cases, but the preferred method would definitely be number one above.