水晶报表:如何将参数从子报表传递到父报表?

编程入门 行业动态 更新时间:2024-10-24 14:25:41
本文介绍了水晶报表:如何将参数从子报表传递到父报表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一些子报表,其中我计算总计。在主报告中,我需要这些总和的总和。

I have a number of subreports in which I calculate totals. In the main report I need the sum of those totals.

我不知道如何获取子报表中总计的访问权限。

I don't know how to get acces to the totals in the subreports.

推荐答案

您需要查看使用共享变量,可以通过父报表及其子报表读取和写入。

You need to look into using Shared Variables, which can be read and written to by both the parent report and its subreports.

示例:

在父报表中,用于初始化名为InitTotal的公式的公式包含文本:

In parent report, a formula to initialise things called 'InitTotal', containing the text :

Shared NumberVar MyTotal := 0;

将此公式置于报表标题中并将其禁止。为每个名为AddTotal的子报表添加一个公式,其中包含文本:

Place this formula in the report header and suppress it. Add a formula to each subreport called 'AddTotal', containing the text :

Shared NumberVar MyTotal := MyTotal + {FieldToAddToTotal};

将此公式添加到子报表的报表页脚并将其压缩。

Add this formula to the subreport's report footer and suppress it.

最后,在父报表的报表页脚中,添加另一个名为DisplayTotal的公式,只包含文本:

Finally, in the report footer of the parent report, add another formula called 'DisplayTotal' containing just the text :

Shared NumberVar MyTotal;

更多推荐

水晶报表:如何将参数从子报表传递到父报表?

本文发布于:2023-10-30 11:58:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1542783.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报表   如何将   水晶   参数   从子

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!