In my crystal report, which is linked to a SQL Server Database via a DataSet (*.xsd-File), I am displaying data from several tables. It also has some sub reports.
In the main report, I display data from two tables. When there is a record to display for both tables it works, but when there is only a record in the first table and the corresponding record in the other table is null (which is ok), it displays none data.
Example:
Let’s say I have a table Person and Address. A Person can have an Address, but it can be empty (null) as well.
When I want to display a report for a Person, which has an Address, it displays all wanted fields (like Person.Name, Person.Age, Address.Street etc.).
If I want to display a report for a Person, which has no Address, it obviously cannot display any address data, but it also doesn’t display the person’s fields.
What could be the cause for this?
Can I improve my question to clarify something? I am using VS2010.
I found out, what was wrong and did the following to correct it:
In Visual Studio 2010, when you opened the rpt-File, click in the menu on Crystal Reports and open Database > Database Expert…
There you have to switch to the Links tab and there I had to reverse the link between my two tables and change in the link options the Join Type from “Inner Join” to “Left Outer Join“.
After I did that, it worked as I expected.