将子报表值传递给主报表 [英] Passing Subreport Value to Main Report

查看:97
本文介绍了将子报表值传递给主报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的报告中,我通过子报表的总计显示在主报表中,我使用以下公式,

In my Report I am passing the Total of Subreport to display in the Main Report for that I am using the below Formula,

在子报表中,

WhilePrintingRecords;
Shared Numbervar EvTotal:= cdbl({Evaluation_Details.NOOFCOPIESEVALUATED})

Shared NumberVar EvTotal;
EvTotal;

但是当我包括用于在主报表中显示的公式时,它是Dispalying0而不是Total of SubReport

but when I Include the Formula for displaying in the Main Report it is Dispalying "0" instead of Total of SubReport

推荐答案

有几件事情:
在代码中有一些错字。这里你缺少分号在结尾:

A couple of things: You have some typos in your code. Here you were missing the semi-colon at the end:

WhilePrintingRecords;
Shared Numbervar EvTotal:= cdbl({Evaluation_Details.NOOFCOPIESEVALUATED});

在这里你不需要分号:

Shared NumberVar EvTotal;
EvTotal

正如@Raphael指出的,重要的是,在层次结构中比调用变量的主报表中的公式。我也建议有WhileReadingRecords;在这两种方式,你确保他们同时评估。此外,作为一个小调试帮助,把EvTotal在第一个公式的末尾,这样你可以看到的值是/应该是。

And as @Raphael pointed out, it is important that you have the subreport higher in the hierarchy than the formula in the Main Report that calls the variable. I would also suggest to have "WhileReadingRecords;" in both, that way you ensure they evaluate at the same time. Also, as a little debugging help, put "EvTotal" at the end of the first formula, that way you can see what the value is/should be.

这篇关于将子报表值传递给主报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆