Crystal Reports:如何将参数从子报表传递到父报表?

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

我有许多子报表用于计算总计.在主报告中,我需要这些总数的总和.

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;

更多推荐

Crystal Reports:如何将参数从子报表传递到父报表?

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

发布评论

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

>www.elefans.com

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