FastReport - 如何将特定的组页脚值求和到新的页脚区域
我正在尝试使用 fastreport 和 delphi 执行以下操作。我有一份报告,其中包含...
GroupHeader -------->客户推销员的关键 主数据------>客户姓名、余额 组页脚 --------> Salesman-1 的总和(余额) 主数据------>客户姓名、余额 组页脚 --------> Salesman-2 的总和(余额) 主数据------>客户姓名、余额 组页脚 --------> Salesman-3 的总和(余额) 。 。 。 主数据------>客户姓名、余额 组页脚 -------->推销员-N 的总和(余额)
====>这里想要有: 页脚-2 --------> SUM( 销售员 1 的总和(余额)、销售员 2 的总和(余额)、销售员 3 的总和(余额) ) (仅!!!)
ReportFooter -------->客户总余额。
有谁有解决 fastreport 脚本引擎问题的想法吗?
谢谢。
i'm trying to do the following with fastreport and delphi. I have a report containing...
GroupHeader -------> Key to Customer Salesman
MasterData -------> CustomerName, Balance
GroupFooter -------> Sum(Balance) of Salesman-1
MasterData -------> CustomerName, Balance
GroupFooter -------> Sum(Balance) of Salesman-2
MasterData -------> CustomerName, Balance
GroupFooter -------> Sum(Balance) of Salesman-3
.
.
.
MasterData -------> CustomerName, Balance
GroupFooter -------> Sum(Balance) of Salesman-N
====> Here want to have :
Footer-2 -------> SUM( Sum(Balance) of Salesman-1, Sum(Balance) of Salesman-2, Sum(Balance) of Salesman-3 ) (ONLY !!!)
ReportFooter --------> Total Customer Balance.
Has anyone an idea to solve the problem with fastreport script engine?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将创建一个报告全局变量“salessum”,
如果它是所需的推销员之一,则在详细信息区域的 OnBeforePrint 事件中增加 salessum。
如果您希望在报告末尾添加额外的总和,请添加报告摘要区域,并在 OnBeforePrint 事件中将相应文本字段的值设置为 salessum 的格式化字符串。
或者,如果您希望在销售员 3 小计之后立即添加额外总和,则在销售员组页脚区域中添加一个文本字段,并在 OnBeforePrint 事件中将其可见属性设置为 true/false,具体取决于您当前正在处理的销售员键并设置其值与 salessum 的值之比。您还需要确保带子自动拉伸。
我已经开始使用脚本和报告变量进行几乎所有求和,因为它变得更容易控制何时何地应该递增或重置或打印等。使用内置求和函数(在任何报告系统中)是唯一有用的非常简单的总数——出于某种原因,我的报告中很少有这样的总数。
希望这是有道理的(这就是您真正想要实现的目标!)。
I would create a report global variable 'salessum'
In the OnBeforePrint event of the detail band increment the salessum if it is one of the desired salesmen.
If you want the extra sum at the end of the report then add a report summary band and in the OnBeforePrint event set the value of the appropriate text field to the formatted string of salessum.
Alternatively, if you want the extra sum immediately after the salesman 3 subtotal then add a text field in the salesman group footer band and in the OnBeforePrint event set its visible property to true/false depending on which salesman key you are currently processing and set its value to the value of salessum. You will also need to make sure that the band stretches automatically.
I have started to do pretty much all summing using script and report variable as it becomes so much easier to control when and where they should be incremented or reset or printed etc. Using the built in sum functions (in any reporting system) is only useful for very straightforward totals - which, for some reason, very few of my reports are.
Hope that makes sense (and is what you're actually trying to achieve!).