Create a unique id in crystal reports

2019-08-21 18:14发布

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

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 ""`

1条回答
闹够了就滚
2楼-- · 2019-08-21 18:42

Use a variable.

Try something like this:

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)

Observe there are parenthesis in "then" clause.

查看更多
登录 后发表回答