Crystal Reports-将值从一个参数传递到另一个 [英] Crystal Reports - Passing value from one parameter to another

查看:139
本文介绍了Crystal Reports-将值从一个参数传递到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

水晶版本:2008

我有2个日期参数(开始日期和结束日期).我想创建一个初始的布尔参数;如果为"True",则自动将2个日期参数设置为特定日期;如果为"False",则用户输入开始日期和结束日期.

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.

有什么想法吗?

推荐答案

我认为您应该可以使用共享变量来完成此任务.您可以在报表标题的公式字段中设置值,然后在公式中使用共享变量(而不是日期参数).

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.

更新 :我先前的答案是针对您的特定问题的,但是在阅读您的评论后,我认为您应该尝试做Craig所指的事情.听起来您只是想让用户为一个日期或一系列日期运行报表.与其传递可处理此问题的布尔值,不如简单地使用具有以下设置设置的date参数:

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:

允许多个值

允许离散值

允许范围值

然后,您可以在公式和选择条件中使用参数,这将允许用户指定用户希望使用的日期或日期范围.

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.

我希望这会有所帮助.

这篇关于Crystal Reports-将值从一个参数传递到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆