Crystal Reports:更改页眉中框的填充/背景颜色

huangapple go评论60阅读模式
英文:

Crystal Reports: Change fill/background color of box in page header

问题

我有一个包含分组的多层次下钻报告。其中一个分组是评估,显示的数据是评估日期和KPI。KPI 可以是 R、G、Y 中的任何一个。我想要做的是评估最后一条评估日期记录(最后提交的记录),如果 KPI 是 R,则更改页面页眉中的方框的填充/背景颜色为红色,如果是 Y,则为黄色,如果是 G,则为绿色。

我应该创建一个公式并将其放入部分中,还是应该使用 onlastrecord 或 var?能否提供一个示例?

提前感谢您。

我尝试使用 onlastrecord 编写公式,但没有取得多少进展。

英文:

I have a mutli drill down report containing groups. One group is assessments and the data that displays is assessment date, KPI. KPI can be either a R, G, Y. What I'm trying to do is evaluate the last record of assessment date (last one submitted) and if the KPI is a R then change the fill/background color of a box in the page header to red, do the same if Y, yellow, G, green.

Do I create a formula and drop in it the section and do I use onlastrecord or var. An example would be great.

Thank you in advance.

I tried writing formula using onlastrecord but didn't get very far

答案1

得分: 0

创建一个公式,将日期和KPI连接成一个带分隔符的字符串。
例如:ToText({assessment date}, 'yyyyMMdd') + "||" + {KPI}

在条件格式表达式中,获取连接字符串的最大值,将其拆分为一个数组(使用Split()函数和'||'分隔符),并抓取数组中的第二个元素。这将给您最后评估日期的KPI。

英文:

Create a formula that concatenates the date and the KPI into a delimited string.
For example: ToText({assessment date}, 'yyyyMMdd') + "||" + {KPI}

In the conditional formatting expression, get the maximum value of the concatenated string, split it to an array (using the Split() function and the '||' delimiter), and grab the 2nd element in the array. That gives you the KPI in the last assessment date.

huangapple
  • 本文由 发表于 2023年7月13日 22:39:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76680632.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定