Crystal Report中的可选动态参数(Optional dynamic parameter in Crystal Report)

系统教程 行业动态 更新时间:2024-06-14 17:00:14
Crystal Report中的可选动态参数(Optional dynamic parameter in Crystal Report)

我正在使用CR上的动态参数创建报告。

所有参数都应该是可选的,就像最终用户没有选择任何参数一样,那么它就会像这个参数一样根本不存在。

经过一番搜索后,我找到了.HasValue()函数,使用后报告显示没有数据,所以也许我在这里遗漏了一些东西。

这是我的原始配方

{Command.Invoice Date} in {?Date} to {?To Date} and {Command.SeriesName} = {?Department} and {Command.DocNum} = {?DOCUMENT NO} and {Command.SlpName} = {?Sales Emploee}

将函数插入此公式的正确方法是什么?

I am creating a report with Dynamic parameters on CR.

All the parameters should be optional, as if the end user haven't select any parameter, then it will act like this parameter didn't exist at all.

After some searching I found the .HasValue() function, and after using it the report shows no data at all, so maybe I am missing something here.

Here is the original formula I have

{Command.Invoice Date} in {?Date} to {?To Date} and {Command.SeriesName} = {?Department} and {Command.DocNum} = {?DOCUMENT NO} and {Command.SlpName} = {?Sales Emploee}

What is the right way to insert the function here to this formula?

最满意答案

我经常使用hasValue()函数,如下所示:

(not hasValue({?Date}) OR {Command.Invoice Date} >= {?Date}) and (not hasValue({?To Date}) OR {Command.Invoice Date} <= {?To Date}) and (not hasValue({?Department}) OR {Command.SeriesName} = {?Department}) and (not hasValue({?DOCUMENT NO}) OR {Command.DocNum} = {?DOCUMENT NO}) and (not hasValue({?Sales Emploee}) OR {Command.SlpName} = {?Sales Emploee})

因此,参数没有值,或者根据参数值检查列中的值。

I have most often used the hasValue() function as follows:

(not hasValue({?Date}) OR {Command.Invoice Date} >= {?Date}) and (not hasValue({?To Date}) OR {Command.Invoice Date} <= {?To Date}) and (not hasValue({?Department}) OR {Command.SeriesName} = {?Department}) and (not hasValue({?DOCUMENT NO}) OR {Command.DocNum} = {?DOCUMENT NO}) and (not hasValue({?Sales Emploee}) OR {Command.SlpName} = {?Sales Emploee})

So either the parameter doesn't have value or the value in the column is checked against the parameter value.

更多推荐

本文发布于:2023-04-18 00:57:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/0cc8f5b3025db505091bc1f6dcec53fa.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可选   参数   动态   Report   Crystal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!