水晶报表脚本查找最大值标题?(简单问题!)
请帮忙!
我在很多论坛上问过我的问题,但没有收到任何明确的答案。
这是我的问题:
我在“详细信息”部分中创建了一个表,并且此表中有一个“标题列”和“点列”,如何编写代码来查找表中最大点的标题???
这是我的 .rpt 概述:
(来源:googlepages.com)
您看到我在详细信息部分有 3 列。点、BitParagonTitle、字母表。
我想根据报告页脚中的最大点向用户显示 BitParagonTitle。
我如何在水晶报表中执行此操作?请帮助我!!!
所以我想:
- 找到点列的最大值。
- 查找 Max Point 的标题。
我在 ArrayList 中创建了一个数据对象集合作为报表数据源。
请帮我编写一些水晶报表脚本,以找到最大点的标题并将其显示在组页脚中。
这一点很重要,因为我不使用 SQL DB 过程或表作为数据源,并且按照我所说的那样手动收集数据。
Please Help!
I asked my Q in many Forums but i did'nt recieve any clear answer.
This is my Q:
I created a table in a Details Section and I have a Title Col and Point Col in this table how can I write code to find Title of max point in my table???
this is my .rpt overview:
(source: googlepages.com)
you see i have 3 cols in Details Section. Point,BitParagonTitle,Alphabet.
I want to show BitParagonTitle to user according to Maximum of point in footer of report.
How can I perform this in Crystal report? please Help me!!!
So I want to:
- Find Maximum Value of point Column.
- Find title of Max Point.
I created a collection of Data Object in an ArrayList as report DataSource.
Please Help me to write some crystal report scripts to find Title of Max Point and show it in Group Footer.
This is Important that I dont use SQL DB Procedures or tables as data source and I Collected Data manually as I said.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定您的所有要求,但如果您不介意对详细信息进行排序,最简单的方法是按点列进行分组,然后如果点按升序排序,您可以简单地将字段标题和点字段放入点组页脚。这将仅显示 Point 列的最后一行,该行又将是最大值,因为它按 asc 排序。
这将为您提供最大行,因此如果您不想看到其他行,您可以简单地隐藏详细信息部分。希望这是有道理的并且有帮助。
I am not sure of all of your requirements, but if you don't mind the Details being sorted the easiest way is to group by the Point column and then if the points are sorted ascending you can simply put the field title and point fields in the Point group footer. This will only display the last row of the Point column which in turn will be the maximum since it is sorted asc.
This will give you the maximum row so if you didn't care to see the other rows you can simply suppress the details section. Hope this makes sense and helps.
您需要在“详细信息”部分中计算的公式中使用一对全局 Crystal 变量,以及引用这些变量的其他两个公式。
这两个变量用于存储最大点以及与之关联的标题(因此大概是一个 NumberVar 和一个 StringVar,称为 MaxPoint 和 MaxPointTitle)。
报告标题中包含一个公式,只需将两个变量初始化为零和空字符串。
第二个位于详细信息部分。它评估当前 Point 值是否高于 MaxPoint 变量中存储的值。如果是,它将新值存储在 MaxPoint 中,将当前标题存储在 MaxPointTitle 中。
在报表页脚中,第三个公式用于显示标题和/或值。
如果您想要组最大值而不是整体值,请将报表标题中的公式移至组标题,然后从报表页脚移至组页脚,它应该可以工作。
You'll need to use a pair of global Crystal variables in a formula that is evaluated in the Details section, as well as two other formulas referring to those variables.
The two variables are to store the max of point, and the title associated with that (so presumably a NumberVar and a StringVar, say called MaxPoint and MaxPointTitle).
One formula goes in the Report Header, and simply initialises the two variables to zero and empty string.
The second goes in the Details section. It evaluates if the current Point value is higher than that stored in the MaxPoint variable. If so, it stores the new value in MaxPoint and the current title in MaxPointTitle.
In the Report footer, a third formula is used to display the title and/or value.
If you want group max values rather than overall ones, move the formula in the Report header to the Group header, and from the Report footer to the Group footer, and it should work.