本文介绍了在Crystal报表中创建唯一的ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了代码窗口中显示的公式,以便每当连续有多个皮卡。

I have created the formula shown in code's window to show "via" wheneverenter image description here there is more than one pickup consecutively.

它很好用,但是每当在Crystal报表中出现 Via时,我都希望显示为Via1,Via2 .... etc。

It works great but whenever "Via" shows up in Crystal report, I want to display as Via1, Via2 ....etc.

`If {Command.ACTIVITY}= 'Pick' and
(previousISNULL ({Command.PASSONBOARD}) or previous
({Command.PASSONBOARD})="")
 and next ({Command.ACTIVITY})='Pick'
 then "Via"
  else ""`


推荐答案

使用变量。

尝试类似这样的事情:

shared numbervar counter;
If {Command.ACTIVITY}= 'Pick' and
(previousISNULL ({Command.PASSONBOARD}) or previous
({Command.PASSONBOARD})="")
 and next ({Command.ACTIVITY})='Pick'
 then counter := counter + 1;
 "Via" + cstr(counter)

观察 then子句中是否有括号

Observe there are parenthesis in "then" clause.

这篇关于在Crystal报表中创建唯一的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 22:57