2008-12-19 96 views
1

使用水晶報告11,我試圖獲取小計金額以強制數據庫字段具有值「貸項憑證」時顯示負數。水晶報告11:將不會否定totext中的數字值

我已經嘗試否定totext函數中的值,因爲您可以在註釋掉下面看到的內容中看到if trantypeilocal =「credit memo」語句,但那不起作用。所以我想我會嘗試將它分配給一個變量,這也會引發錯誤。

Numbervar subtot 

if PageNumber = TotalPageCount then 
    (
     // ToText({tarPrintInvcHdrWrk.SalesAmt}) 
     if {tarPrintInvcHdrWrk.TranTypeIDLocal} = "Credit Memo" then 
     (
      subtot := {tarPrintInvcHdrWrk.SalesAmt}-{tarPrintInvcHdrWrk.ShipAmt}-{#FreightAndHandling}; 
      //ToText (-({tarPrintInvcHdrWrk.SalesAmt}-{tarPrintInvcHdrWrk.ShipAmt}-{#FreightAndHandling}) , {tarPrintInvcHdrWrk.MCDecPlaces}) 
      ToText (-(subtot)); 
      ) 
     else 
     ( 
     ToText ({tarPrintInvcHdrWrk.SalesAmt}-{tarPrintInvcHdrWrk.ShipAmt}-{#FreightAndHandling}, {tarPrintInvcHdrWrk.MCDecPlaces}) 
     ) 
    ) 
    else 
     "**********" 

該錯誤消息表示:

剩餘文本不顯示爲下式的部分。

回答

0

我想通過在if語句中暫時連接以下內容來臨時修復。

"-" + ToText ({tarPrintInvcHdrWrk.SalesAmt}-{tarPrintInvcHdrWrk.ShipAmt}-{#FreightAndHandling}) , {tarPrintInvcHdrWrk.MCDecPlaces}