2010-07-30 62 views
0

嗨我有一个长公式字段,我希望将其作为交叉表报告摘要字段。但是,在定义公式字段后,我没有在交叉表屏幕中看到它。如何包含它? 这里是我的公式字段在交叉表中包含公式字段

WhilePrintingRecords; 
numberVar rt; 
numberVar layMdp; 
numberVar totMdp; 

rt=Round(({Command.GENGNPIAMT}/{Command.TOTALGNP})*100,2); 
layMdp:={Command.GENPREMMDP}; 
totMdp:=(layMdp)*Truncate((rt/100),4); 

另外,如果我把这个公式字段中细节部分,它显示了一个零。为什么它不计算任何东西?我喜欢根据每个交叉表列来计算值。

回答

1

您正在设置变量,但公式本身并未返回任何内容。如果你想返回totMdp的值,只需在最后一行后面添加它即可:

WhilePrintingRecords; 
numberVar rt; 
numberVar layMdp; 
numberVar totMdp; 

rt=Round(({Command.GENGNPIAMT}/{Command.TOTALGNP})*100,2); 
layMdp:={Command.GENPREMMDP}; 
totMdp:=(layMdp)*Truncate((rt/100),4); 
totMdp
+0

由于在第一行中缺少':='也是。 – 2010-07-30 17:49:26