I am working on a Crystal Reports in Visual Studio 2010 and I have a variety of different parameters and prompts for the user to filter out the specific data they want. For example, I have a parameter for Account and a parameter for Product Name dynamically populated. By default, if a user selects a filter for each of these parameters (account A and product B for example) a logical AND is performed. Only rows containing account A and product B are returned.
Is there a way to make this behave as an OR or an AND (user specifies?) So I can return all rows for account A OR product B
I know that it would be easy to change my formulas to treat this as an OR but what I would really like is for the user to be able to somehow specify whether or not the parameter should be treated as an AND or an OR.
If I’m understanding you correctly, you can pass a third string parameter in, call it
{?Logic}, which contains either “AND” or “OR”, and from there you can do:I realize you’re basically repeating the query, once using
ANDand once usingOR, but as long as the query isn’t too cumbersome, this might be the cleanest way to do it.