Crystal Reports - 以编程方式更改组标题抑制公式
使用 Crystal Reports 10 和 vb6/classic(尽管我希望它在任何语言中都是相同的), 是否可以从代码动态更改组标头部分的抑制公式。
我基本上是根据用户输入动态更改特定组上的 GroupConditionField,但在该组标题上有一个抑制字段公式,其中包含对分组总和的检查。
Sum ({@ColourTotal}, {Table.Field}) =0
如果这是真的,该团体就会受到压制。这显然会出现一个错误,抱怨当通过代码更改 GroupConditionField 时找不到该组。
那么有没有办法从代码中更改特定组的抑制公式?
Using Crystal Reports 10 and vb6/classic (although I expect its the same in any language),
is it possible to change a suppression formula on a Group header section dynamically from code.
I'm basically changing the GroupConditionField on a specific group dynamically according to user input, but on that group header there is a suppression field formula containing a check on a grouped sum.
Sum ({@ColourTotal}, {Table.Field}) =0
If this is true, the group gets suppressed. This obviously comes up with an error complaining it can't find the group when the GroupConditionField is changed through code.
So is there a way to change the suppress formula for a specific group from within code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我很抱歉这是 C#,但我有它方便。我需要类似的东西,所以我有一个公式,我将其设置为程序中的值。报告检查该值来决定是否抑制。我怀疑你可以使用相同的技术来改变公式,但我懒得自己测试。
此代码只是将公式字段“Florida”设置为 0 或 1。
I apologize this is C# but I had it handy. I need to so something similar so I have a formula that I set to a value from my program. The report checks this value to decide whether to suppress or not. I suspect you can use the same technique to change the formula, but I'm too lazy to test it my self.
This code just sets the formula field, "Florida" to either 0 or 1.
我相信我已经找到了一种使用组选择公式来做到这一点的方法
报告->选择公式->实际报告中的组。
不理想,需要一些重新格式化,但应该可以。
I believe I have found a way to do it using the Group Selection Formula under
Report->Selection Formulas-> Group inside the actual report.
Not ideal and will involve some reformatting but should work.