Like with most things, Crystal Reports tends to be split into levels of complexity whenever possible. Beginner, Intermediate, Advanced are all used to describe books, courses and articles.The problem is that reporting requirements are dictated by the client and by the nature of the database being reported from. In many cases the initial request may seem simple to implement, but may not be a good logical fit with how the database stores the information.This is one of the subjects which would normally be labelled "Advanced" but is actually a common requirement.Complex ReportingThis article covers how to conditionally use different tables within the same report and how to avoid the common mistakes. Reports of this type are normally the result of mixed rules being applied to the same area within a business. Because the business area is one logical unit to report against, the client wants all the data measured together. This includes the exceptions to the rules, which logically don't fit, but still need including.I am going to use the free sample MS Access Database Xtreme, which ships with Crystal Reports. The report requirement we are going to work towards is:"A single report to show all the customers who have ordered under £500 items, including those that ordered nothing."How Table Linking Really WorksTable linking can be very deceptive and the type of link used between tables may actually change at runtime based on what you put in the report. This is the cause behind why this type of report can be so awkward.We will start the report, and see this in action.
The report will now display the records as expected because if the Customer ID on the Order is null, then the report will not even look at Quantity Amount.This concept can be expanded for more complex formula just by wrapping up second half of the "OR" in brackets.(IsNull({Orders.Customer ID})OR({Orders.Order Amount} < 500ANDyear({Orders.Order Date}) = 2010));This will return any customer with no Orders, or Orders under £500 placed during 2010.SummaryThis simple technique can save hours of development time as the other option is to create two reports and merge them together.There are just two basic things to remember:
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: