Reputation: 33
Hi I'm new in crystal reporting, i would like to make a yearly and monthly report when a button(Yearly Report) is click Yearly Report in crystal report is view. Should i make a formula? or just in Select Expert using is in the period as?Thank you in advance.
Upvotes: 2
Views: 560
Reputation: 10408
You should create a report parameter called: @ReportingPeriod
This can be a series of text options (Monthly, Weekly, Daily, etc.) or it can be numeric on the order of '# of months' (1, 3, 6, 12)
Then you need to edit the 'Report Selection Criteria...' as a formula and append the following code:
(
... EXISTING SELECTION CRITIERIA ...
)
AND
(
(@ReportingPeriod = "Yearly" && {CreateDate} < '1/1/2014')
OR
(@ReportingPeriod = "Monthly" && {CreateDate} < '1/1/2014' && {CreateDate} = '12/1/2014')
)
So the parameter you've created becomes the basis for the filter criteria enabling a variety of scenarios depending on the parameters value.
DISCLAIMER: This pseudo code is conceptual and is not valid Crystal Reports formula code.
Upvotes: 2