Hi,
for your problem about the term, you can add a textbox in the detail section and you can bind this textbox to the field Description of the table "Terms". When you add a textbox on your statement template, a field selector screen appear. In this screen, select the object "Terms" and select the field "TermId". With this field, you will see the term code on your statement template.
To calculate the invoice total showed on your statement, you have to add some script in your template and add a new label in the "CustomerFooter" section.
In the "customerHeader" section on the "OnFormat" event, you have to add this script :
'This script reset the Invoice total to 0 after each customer
Set clsApplication = CreateObject("DynaFoundation.CAppObject")
clsApplication.Application.Properties.SetProperty "InvoiceTotal", 0
In the "Detail" section on the "OnFormat" event, you have to add this script :
'This script calculate the Invoice total for each invoice in the statement
Set clsApplication = CreateObject("DynaFoundation.CAppObject")
total = Helper.GetQueryValue("Select TotAmnt From InvoiHdr where InvoiId = '" & rpt.Sections("Detail").Controls("txtInvoiId").Text & "'")
clsApplication.Application.Properties.SetProperty "InvoiceTotal", clsApplication.Application.Properties.GetProperty("InvoiceTotal",0) + total
In the "CustomerFooter" section on the "OnFormat" event, you have to add this script :
'This script show the Invoice total in the new label on your statement
Set clsApplication = CreateObject("DynaFoundation.CAppObject")
rpt.Sections("CustomerFooter").Controls("lblInvoiceTotal").Caption = clsApplication.Application.Properties.GetProperty("InvoiceTotal")
Jean-François Lefebvre
Dynacom Technologies Inc.
www.dynacom.ca