【问题标题】:Hide or show image based on column values根据列值隐藏或显示图像
【发布时间】:2015-03-27 11:07:11
【问题描述】:

我正在编写一份报告,我需要在其中根据列的值显示或隐藏图像。例如:如果“详细信息”部分中不存在值 18,则必须按照附图中的说明隐藏图像 18

我尝试使用一个数组,在其中插入了我需要使用的列的值。这是我尝试使用的抑制表达。

shared numbervar array MyArray;
MyArray:=makearray({MyTable.MyColumn});
local numbervar i;
local booleanvar result = true;
for i:=1 to ubound(MyArray)
do
  if (MyArray[i] = 17) then 
  result := false;
result

我意识到图像没有隐藏,因为我正在处理页眉,我只能访问表格的第一行。

【问题讨论】:

    标签: crystal-reports formula


    【解决方案1】:

    由于您在页眉中隐藏图像,因此您仅限于使用简单的聚合函数,并且无法使用变量、运行总计等。

    这并不难,但很乏味,因为您必须为每个值创建一个新公式。

    //@CheckValue1
    if {table.value}=1 then 1 else 0
    
    //@SuppressionValue1
    // If this evaluates to 'true' anywhere in your report, including the PH,
    // you know value 1 does not appear in your report
    maximum({@CheckValue1})=0
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      相关资源
      最近更新 更多