Passing Subreport Value to Main Report

China☆狼群 提交于 2019-12-19 03:15:02

问题


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

In Subreport,

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

In Main Report,

Shared NumberVar EvTotal;
EvTotal;

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


回答1:


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});

And here you don't need the semi-colon:

Shared NumberVar EvTotal;
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.




回答2:


The formula that you created in the sub-report must be placed in the detail section or Group header. You can hide this field. Then it will show up the correct value.



来源:https://stackoverflow.com/questions/20560075/passing-subreport-value-to-main-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!