devexpress xtrareport

14 篇文章 0 订阅
5 篇文章 0 订阅

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;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值