Report Script: Create a Packing List in report script: Difference between revisions

No edit summary
 
(4 intermediate revisions by one other user not shown)
Line 1:
==Introduction==
This tutorial shows how to add a text which displays packing that is based on largest UOM to smallest UOM with report scripting.<br/>
Does not take into consideration of multi-location, area and customer.
 
==Tasks in this tutorial==
Line 50:
#*'''using System.Data;'''
#*'''using System.Linq;'''
 
===Insert scripts into '''calcPacking_GetValue'''===
<syntaxhighlight lang="csharp">
Line 55 ⟶ 56:
private void calcPacking_GetValue(object sender, DevExpress.XtraReports.UI.GetValueEventArgs e)
{
//Get all UOM of current Item, and store in DataTable
DataTable tblUOM = GetUOMFromItem(GetCurrentColumnValue("ItemCode"));
if (tblUOM == null)
return;
 
//GetCalculate totalthe quantity of smallest UOM Qtythat ofhas the same "ItemCode" and "UOMRate"
//It is based on the design of this report that uses "Group Header" to group "ItemCode" and "UOMRate"
decimal smallestQty = GetSmallestQty(GetCurrentColumnValue("ItemCode"), GetCurrentColumnValue("UOMRate"));
 
Line 88 ⟶ 90:
}
</syntaxhighlight>
 
#Add function of '''GetSmallestQty'''
#Add function of '''GetUOMFromItem'''
Line 130 ⟶ 133:
</syntaxhighlight>
 
<br/>
===Add label to display "Packing"===
#Add a new Label into existing Group Header
1,155

edits