如何在Crystal报表选择专家中使用通配符 [英] how to use wildcard in Crystal report selection expert

查看:80
本文介绍了如何在Crystal报表选择专家中使用通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在另一个论坛上发现了这个问题

i found this on another forum

设置参数的默认值 ALL

set your default value 'ALL' for parameter

如果选择专家的语句:

If {?Parameter}='ALL' 
Then {Database.Field} like '*' 
Else {Database.Field} = {?Parameter} and
{fctime_ts} >= {@StartDate} and 
{fctime_ts} < {@EndDate}

由于某些原因,它没有使用日期约束而无法正常工作。因此,然后我尝试了以下操作。

that didnt work, for some reason it isnt using the date constraints. So then i tried the following.

{fpartno} = IIF({?PartNbr} = 'All', '*' , {?PartNbr}) 

如果我使用实际零件号,效果很好,但是当我使用完全取消它。

that works great if i use an actual part number, but when i use the defaul ALL it doesnt work at all.

这是我完整的选择公式:

this is my complete selection formula:

fpartno} = IIF({?PartNbr} = 'All', '*' , {?PartNbr}) and 
{fctime_ts} >= {@StartDate} and 
{fctime_ts} < {@EndDate} 

任何人都知道如何使该论坛上提到的答案带有日期或如何工作

anyone know how to either make the mentioned answer on this forum work with dates or how ot make this way work?

推荐答案

我对您的建议有疑问,但我找到了这个答案。

I had a problem with what you recommended, but i found this answer.

这是它的工作原理,它检查PartNbr是否等于 All。如果是,则跳至日期限制。通过跳过,它将依次选择该日期范围内的所有零件。如果PartNbr不等于'All',它将使用PartNbr并在日期范围内获得具有该编号的零件。

This is how it works, it checks to see if PartNbr is equal to 'All'. If it does then it skips to the date restraints. By skipping, it will in turn select all the parts in that date range. if PartNbr doesn't equal 'All', it will take PartNbr and get the parts with that number within the date range.

此解决方案对我来说非常有用如果有人来了,则id更新

This solution worked great for me, just htought id update if someone came by

({?PartNbr} = 'All'
or
{?PartNbr}= {intran.fpartno}) and
{intran.fctime_ts} >= {@StartDate} and
{intran.fctime_ts} <= {@EndDate}

这篇关于如何在Crystal报表选择专家中使用通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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