Create custom summary in End User Designer (script) (windows form)
/
// select a label (should in correct band(group footer,header ...)) which you want to custom set value
// click smart tag -> select summary
// in Summary Editor
// 1. Bind field (select the field for the label custom value, could leave it empty if you don't need it)
// 2. Summary function (select custom)
// 3. Summary running (any you want) -> OK
// swith to script tab -> h t t p://documentation.devexpress.com/#XtraReports/CustomDocument2615
// reference
// h t t p://documentation.devexpress.com/#XtraReports/CustomDocument2617
// h t t p://documentation.devexpress.com/#XtraReports/CustomDocument2622
// h t t p://documentation.devexpress.com/#XtraReports/CustomDocument2615
// h t t p://documentation.devexpress.com/#XtraReports/DevExpressXtraReportsUIXRLabel_SummaryCalculatedtopic
//
//Note:
// becareful for *Level* property of the GroupHeaderBand and GroupFooterBand, select the same level for the same group.
// put the custom label in the "GroupFooter1"(create manually), not in the "GroupFooterBand1"(created by wizard).
///
// scripts in script tab
decimal totalIn = 0;
decimal totalOut = 0;
private void label26_SummaryCalculated(object sender, DevExpress.XtraReports.UI.TextFormatEventArgs e) {
totalIn = Convert.ToDecimal(e.Value);
}
private void label27_SummaryCalculated(object sender, DevExpress.XtraReports.UI.TextFormatEventArgs e) {
totalOut = Convert.ToDecimal(e.Value);
}
private void label35_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e)
{
e.Result = Math.Abs(totalIn - totalOut);
e.Handled = true;
}
private void label39_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (totalIn > totalOut)
{
e.Result = "IN";
}
else if (totalIn < totalOut)
{
e.Result = "OUT";
}
else
{
e.Result = "EQUAL";
}
e.Handled = true;
}