简体   繁体   English

使用AND逻辑而非OR的多值参数

[英]Multi-value parameter using AND logic instead of OR

My report uses a multi-value parameter string to search through a block of text. 我的报告使用多值参数字符串搜索文本块。 We want the ability to only return results that meet all the values entered for this string. 我们希望能够只返回满足为此字符串输入的所有值的结果。 For example: Only return rows that have "Biopsy", "Prostate", AND "Lateral" values. 例如:仅返回具有“活检”,“前列腺”和“横向”值的行。

How can I accomplish this? 我该怎么做?

I'm not sure if crystal report accepts that condition (REGEXP_LIKE). 我不确定Crystal Report是否接受该条件(REGEXP_LIKE)。 Btw... You have to send the parameters one by one, for example: 顺便说一句...您必须一一发送参数,例如:

Dim p As New Report
p.parameter1 = txtParameter1.Text
p.parameter2 = txtParameter2.Text
p.parameter3 = txtParameter3.Text
p.show()

Then in report 然后在报告中

Public parameter1 As String
Public parameter2 As String
Public parameter3 As String

If String.IsNullOrWhiteSpace(parameter1) Then
    "report-object".SetParameterValue("Parameter in Query", "'%'")
Else
    "report-object".SetParameterValue("Parameter in Query", "'" + parameter1 + "%'")
End If
.
.

I usually use this code for that.. and well in your command object, you only need a simple AND to match the parameters. 我通常为此使用代码。在您的命令对象中,只需一个简单的AND即可匹配参数。

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

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