Crystal Reports - Passing value from one parameter to another

本秂侑毒 提交于 2019-12-11 05:19:17

问题


Crystal Version: 2008

I have 2 date parameters (start date and end date). I want to create an initial Boolean parameter; that if, 'True' automatically sets the 2 date parameters to specific dates, if 'False' the user enters the start date and end date.

Basically, I want to create a parameter to drive another parameter.

Any thoughts?


回答1:


I think you should be able to use shared variables to accomplish this. You can set the values in a formula field the report header and then use the shared variables (instead of the date parameters) in your formulas.

I don't believe this will work for your main reports selection criteria though. To use it in that method you'd have to select all of the comparison data and suppress the data that you don't want to see at print time.

Update: My previous answer was directed to your specific question, but after reading your comment I think you should try to do what Craig is referring to. It sounds like you simply want to allow the user to run the report for either one date or for a range of dates. Instead of passing a boolean value that would handle this you should simply use a date parameter that has the following setting set:

allow multiple values

allow discrete values

allow range values

Then you can use the parameter in your formulas and selection criteria which will allow the use to specify the date or the date range that the user wishes to use.

I hope this helps.




回答2:


Try this approach: Crystal Reports: Named-Date-Range Parameters



来源:https://stackoverflow.com/questions/6191975/crystal-reports-passing-value-from-one-parameter-to-another

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!