Report Script: Filter Overdue Letter with specific age that is due: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 100:
 
===Calculate Total Overdue Amount after records in detail table is updated===
This sample code,Apply a method '''Compute(...)''' of DataTable object is used to calculate the sum of AmountDue.<br/>
*Add a local variable '''myOverdueMsg'''
<syntaxhighlight lang="csharp">
private string myOverdueMsg = null;
</syntaxhighlight>
*Insert script to '''xrLabelOverdueTitle_BeforePrint''' event
<syntaxhighlight lang="csharp">
private void xrLabelOverdueTitle_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
object oAccNo = GetCurrentColumnValue("AccNo");
if (oAccNo == null) return;
{
 
string orgText = (sender as XRLabel).Text = "";
//Temporary store the original text of this label
return;
string orgText = (sender as XRLabel).Text;
}
//Temporary storeStore the original text of this label
if (myOverdueMsg == null)
{
myOverdueMsg = (sender as XRLabel).Text;
}
 
//Calculate the current debtor total overdue amount
Line 116 ⟶ 127:
 
//Assign 'total amount due' to this label, while format the decimal digit with currency formatting
(sender as XRLabel).Text = string.Format(orgTextmyOverdueMsg, __report.DecimalSetting.FormatCurrency(totalAmtDue));
}
</syntaxhighlight>