Wiki

Case Status
Register Log In

Wiki

 
Invoice & Quotation Template C…
  • RSS Feed

Last modified on 2/16/2013 8:44 PM by User.

Invoice & Quotation Template Changes - Script changed only Example

This is the procedure followed to to create a new printed label that was set using scripts only. As it did not require dataset / table changes it was done using this method



1. Copy the following code to the end of the script of the template

Dim paid as Decimal
Dim tot as Decimal

Private Sub lblTotal_SummaryCalculated(ByVal sender As Object, ByVal e As DevExpress.XtraReports.UI.TextFormatEventArgs)
tot = Convert.ToDouble(lblTotal.Summary.GetResult())
End Sub

Private Sub lblTotalPaid_SummaryCalculated(ByVal sender As Object, ByVal e As DevExpress.XtraReports.UI.TextFormatEventArgs)
paid = Convert.ToDouble(lblTotalPaid.Summary.GetResult())
End Sub

Private Sub lblTotalOustanding_SummaryGetResult(ByVal sender As Object, ByVal e As DevExpress.XtraReports.UI.SummaryGetResultEventArgs)
e.Result = tot - paid
e.Handled = True
End Sub

3. Assign lblTotal_SummaryCalculated to the "Summary Calcualted" scripts element for lblTotal

4. Assign lblTotalPaid_SummaryCalculated to the "Summary Calcualted" scripts element for lblTotalPaid

5. After the TOTAL PAID field, add a BALANCE TO PAY text label and a new XRlabel with the name of lblTotalOutstanding

6. Set the summary to REPORT, SUM and format at C2

7. Assign lblTotalOustanding_SummaryGetResult to the "Summary Get Result element for lblTotalOutStanding