This report should only show one fiscal year at a time. The
ASP.NET application will prompt the user for the fiscal year and the report
will filter the report dynamically. To do this we will create a formula in the
report for the fiscal year and dynamically change this formula using the
Crystal Reports Object Model. We will set the selection formula in the report
to select only these records.
1.
First create the FiscalYear formula. Right click on the Formula Field in
the Field Explorer and select New… from the pop-up menu.
2.
Enter FiscalYear for the formula name and click the Use Editor button.
3.
Enter 2003 for the formula text and then click the Save and Close
button.
4.
Now you need to set the selection formula in the report. From the Visual
Studio menu select Crystal ReportsàReportàSelection FormulaàRecord…
5.
Enter the following formula.
Listing 3
Year ({SalesOrderHeader.OrderDate}) = {@FiscalYear}
6.
Click the Save and Close button.