显示特定数据库字段 Crystal 的公式
有没有办法设置一个公式来根据另一个字段中的值显示一个值?
假设如果 new_field = -1 则在该数据行的 new_field2 中显示信息?一个公式如何运作?
我现在已经尝试过做一个公式 if{table.order} = 3 then {table.value} ...该值是一个数字...但每次只显示 0.0,而拖动时该值与上面显示的其他记录正常显示并将数据库值字段放入我的组中。我试图将此公式放入报表页脚中,以显示其中一条记录的附加信息。
Is there any way to set up a formula to display a value depending on the value in another field?
Say if new_field = -1 then display info in new_field2 of that data row? How would a formula for that work?
I've tried it now with doing a formula that just has
if{table.order} = 3 then {table.value} ...the value is a number...but it is just showing 0.0 each time while the value is showing up normally with the other records that display above when just dragging and dropping the database value field into my group. I'm trying to put this formula in the report footer to display additional information on one of the records.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
创建类似于以下内容的公式: @DisplayNote
Global stringvar xx;
if {db.field1.value} = 1 then xx:= "your text" else xx:= ""
然后创建一个运行总计公式: #DisplayText
选择 @DisplayNote 公式作为要汇总的字段。
摘要类型 = 最大值
然后将 #DisplayText 放在页脚上。
Create a formula similar to the following: @DisplayNote
Global stringvar xx;
if {db.field1.value} = 1 then xx:= "your text" else xx:= ""
Then create a running total formula: #DisplayText
Select the @DisplayNote formula as the field to summarize.
Type of summary = maximum
Then place the #DisplayText on the pagefooter.
在页脚中,现在无法显示报表中任何单个记录的信息。它们都已被处理,并在处理页脚时消失。
您可以设置一个全局变量,并在处理感兴趣的记录时在详细信息部分的隐藏公式中设置该值。使用公式在页脚中显示全局变量值。
In the footer, it is too late to display info on any single record in the report. They have all been processed and are gone by the time the footer is proocessed.
You could probably set up a global variable and set the value in a hidden formula in the detail section when the interesting record is processed. The use a formual to display the global variable value in the footer.
尝试将公式值的最大值插入报表页脚,而不是公式值本身。
Try inserting the maximum of the formula value into the report footer, instead of the formula value itself.