If you don't have a lot of data, pmax9999's answer about using the Select Expert will work. However, the filter won't be pushed down to the database for processing. Instead, Crystal will pull ALL of the data into memory and filter it there. If you have thousands of records, this can significantly slow down the report.
There is a way around this if you don't need any subreports in your report, you could do this:
1. Create a command for your report that just pulls in the current date from the database. You need to have at least one record in a main report for a subreport to run.
2. Suppress all sections in the main report except the report header. You may also want to keep the page header and footer sections, but you may not need them.
3. Create a formula in the main report that returns FileAuthor. I'll call this "{@Author}".
4. Create a subreport that uses your command. In the command, create the parameter for the author. Change it slightly to use the author - it will look something like this:
Code:
...
WHERE TABLE.FILED1 = '{?FileAuthor}'
You'll need the quotes around it for it to work correctly.
5. In the main report, create a subreport link
- From the left column select {@Author}
- In the drop-down at the bottom left, select the parameter from the command - in this case {?FileAuthor}.
- Save the link.
This will set the value of the parameter in the command based on the value of the {@Author} formula in the main report.
6. Subreports don't allow you to set page headers or footers. So, if you need page headers in the subreport and you're grouping your data, go to the Options tab of the Group Expert for the outer-most group and turn on "Repeat Group Header on Each Page". Create a separate group header section for that group and put your page header there. In order to prevent this from appearing between groups if you have multiple groups on a page, you go to the Section Expert for this header section and use a formula something like this:
Code:
not OnFirstRecord and
not InRepeatedGroupHeader
For more information about working with commands, please see
-Dell
Associate Director, Data & Analytics
Protiviti