简体   繁体   English

Crystal Report中的可选动态参数

[英]Optional dynamic parameter in Crystal Report

I am creating a report with Dynamic parameters on CR. 我正在使用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. 经过一些搜索后,我发现了.HasValue()函数,使用它后,报告根本不显示任何数据,因此也许我在这里遗漏了一些东西。

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? 在此公式中插入函数的正确方法是什么?

I have most often used the hasValue() function as follows: 我最常使用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})

So either the parameter doesn't have value or the value in the column is checked against the parameter value. 因此,要么参数没有值,要么对照参数值检查列中的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM