2010-07-30 60 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