Parameters 将多值参数连接到子报表 我有一个水晶席报告,有一个主要的报告和很多的子报告。

Parameters 将多值参数连接到子报表 我有一个水晶席报告,有一个主要的报告和很多的子报告。,parameters,crystal-reports,parameter-passing,crystal-reports-xi,subreports,Parameters,Crystal Reports,Parameter Passing,Crystal Reports Xi,Subreports,我已将所有子报告链接到2个参数,这两个参数对于标准的单个匹配非常有效,但是我现在需要能够为我可以设置的参数之一选择多个标准,但它只是无法将详细信息传递给子报告 这是我当前在主报告记录选择中的内容 {Communication.Comm_Status} = "Complete" and isnull ({Communication.Comm_Deleted}) and {Communication.Comm_Action} = "PhoneOut" and {Communication.comm_

我已将所有子报告链接到2个参数,这两个参数对于标准的单个匹配非常有效,但是我现在需要能够为我可以设置的参数之一选择多个标准,但它只是无法将详细信息传递给子报告

这是我当前在主报告记录选择中的内容

{Communication.Comm_Status} = "Complete" and
isnull ({Communication.Comm_Deleted}) and
{Communication.Comm_Action} = "PhoneOut" and
{Communication.comm_Result} in ["0", "1", "2"] and
not ({Communication.Comm_UpdatedBy} in [30, 33, 59]) and
{Communication.Comm_DateTime} in LastFullWeek and
{Territories.Terr_Caption} = {?Client} and
{Company.comp_campaign} = {?Campaign}
isnull ({Communication.Comm_Deleted}) and
{Communication.Comm_Status} = "Complete" and
{Territories.Terr_Caption} = {?Pm-Territories.Terr_Caption} and
{Territories.Terr_Caption} = {?Pm-Territories.Terr_Caption} and
{Communication.comm_Result} in ["0", "1", "2", "3", "4"] and
not ({Communication.Comm_UpdatedBy} in [30, 33, 59]) and
{Communication.Comm_DateTime} in LastFullWeek and
{Company.comp_campaign} = {?Pm-Company.comp_campaign}
这就是我在子报表记录选择中的内容

{Communication.Comm_Status} = "Complete" and
isnull ({Communication.Comm_Deleted}) and
{Communication.Comm_Action} = "PhoneOut" and
{Communication.comm_Result} in ["0", "1", "2"] and
not ({Communication.Comm_UpdatedBy} in [30, 33, 59]) and
{Communication.Comm_DateTime} in LastFullWeek and
{Territories.Terr_Caption} = {?Client} and
{Company.comp_campaign} = {?Campaign}
isnull ({Communication.Comm_Deleted}) and
{Communication.Comm_Status} = "Complete" and
{Territories.Terr_Caption} = {?Pm-Territories.Terr_Caption} and
{Territories.Terr_Caption} = {?Pm-Territories.Terr_Caption} and
{Communication.comm_Result} in ["0", "1", "2", "3", "4"] and
not ({Communication.Comm_UpdatedBy} in [30, 33, 59]) and
{Communication.Comm_DateTime} in LastFullWeek and
{Company.comp_campaign} = {?Pm-Company.comp_campaign}
我想理想的情况是参数1中的“=”和参数2中的“contains”

我试图寻找解决方案,但我不知道我应该寻找什么术语;多值参数还是别的什么


提前感谢您的指导。

在您的示例中,我不太确定哪个参数是哪个,但您可以执行以下操作:

({tableName.tableField} = {?parameter1} AND
InStr({tableName.tableField}, {?parameter2}) > 0)
这将确保您的字段等于参数1,并且该字段中包含参数2。如果字段是不同的数据类型,则可能需要将其转换为字符串

编辑:

对不起,我想我没有100%地注意这个问题。如果您有一个多值参数,那么您必须将其视为一个数组(这就是为什么我的原始公式会出现错误)。为了在数组中循环,需要创建如下公式:

 WhilePrintingRecords;
 numbervar x := 1;
 numbervar y := 0;

 while x <= ubound({?Campaign})

 do
 (if instr({Company.comp_campaign},{?Campaign}[x],1) > 0
 then y := y + 1;
 x := x + 1);

 y

然后在记录中选择您需要检查的公式>0。

Hi!感谢这一点,它可以工作,我如上所述添加,并得到'这个数组必须订阅。例如:数组[i]'有什么想法吗?你能发布完整的声明吗?{Communication.Comm_Status}=“Complete”和isnull({Communication.Comm_Deleted})和{Communication.Comm_Action}=“PhoneOut”和{Communication.Comm_Result}在[“0”、“1”、“2”]中,而不是在[30、33、59]中({Communication.Comm_UpdatedBy})和{Comm DateTime}在LastFullWeek和({Territions.Terr_Caption}={Client}和InStr({Company.comp_campaign},{campaign})>0中,当错误显示它突出显示{campaign}时,您能给我一个{Company.comp_campaign}值的示例吗?对于{?Campaign},您有什么数据类型和值?我只是在我的系统上做了一个样本,我在回答中给你的公式很好用。试一下我给你的公式,在记录中没有其他选择,看看你是否有错误。然后一次添加一行,看看从哪里得到错误。在{Company.comp_campaign}中的值是多少?是2位或3位的值,其中可以有1个或多个选项,每个选项用逗号分隔,如:,142102228142346228,我需要排除包含,346的记录,无论是单个值还是包含其他值。这有意义吗?