1、我想在应收跟踪表上面增加统计列和其他字段,代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kingdee.BOS;
using Kingdee.BOS.Util;
using Kingdee.BOS.Contracts;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.List;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Contracts.Report;
using Kingdee.BOS.Core.CommonFilter;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.K3.FIN.AR.App.Report;
namespace Kingdee.K3.FIN.AR.App.Report.Bgextend
{
public class TraceReportExtend : TraceReport
{
private string[] customRptTempTableNames;
///
/// 重载取数插件
/// 应收单扩展
///
///
///
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
//设置精度控制
SetDecimal();
//创建临时表,用于存放自己的数据
IDBService dbservice = Kingdee.BOS.App.ServiceHelper.GetService
customRptTempTableNames = dbservice.CreateTemporaryTableName(this.Context, 1);
string strTable = customRptTempTableNames[0];
//调用基类的方法,获取初步的查询结果到临时表
base.BuilderReportSqlAndTempTable(filter, strTable);
//当前日期
string thisDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//对初步的查询结果进行处理,然后写回基类默认的存放查询结果的临时表
StringBuilder sb = new StringBuilder();
string strSql = "select m.FNAME as F_bg_SalerName,re.FTAXPRICE,re.FNOTAXAMOUNTFOR,re.FTAXAMOUNTFOR,re.FENTRYTAXRATE,"
+ " (CASE WHEN datediff(dd,r.FENDDATE,'" + thisDate + "') < 0 THEN NULL ELSE datediff(dd,r.FENDDATE,'" + thisDate + "') END) AS FMATUREDDAYS "
+ ",o.* into {0} "
+ " from {1} o left join t_AR_receivable r on o.FSRECEIVEBILLNO=r.FBILLNO "
+ " left join t_AR_receivableEntry re on o.fentryid=re.FENTRYID left join V_BD_SALESMAN_L m on r.FSALEERID=m.fid ";
sb.AppendFormat(strSql, tableName, strTable);
DBUtils.Execute(this.Context, sb.ToString());
}
///
/// 设置统计列
///
///
///
public override List
{
List
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FNOTAXAMOUNTFOR", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FTAXAMOUNTFOR", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FPRICEQTY", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FALLAMOUNTFOR", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
return summarys;
}
///
/// 设置精度控制
///
public void SetDecimal()
{
List
list.Add(new DecimalControlField
{
ByDecimalControlFieldName = "FTAXPRICE",
DecimalControlFieldName = "FAMOUNTDECIMAL"
});
list.Add(new DecimalControlField
{
ByDecimalControlFieldName = "FENTRYTAXRATE",
DecimalControlFieldName = "FAMOUNTDECIMAL"
});
list.Add(new DecimalControlField
{
ByDecimalControlFieldName = "FTAXAMOUNTFOR",
DecimalControlFieldName = "FAMOUNTDECIMAL"
});
list.Add(new DecimalControlField
{
ByDecimalControlFieldName = "FNOTAXAMOUNTFOR",
DecimalControlFieldName = "FAMOUNTDECIMAL"
});
base.ReportProperty.DecimalControlFieldList = list;
}
///
/// 当关闭报表时,触发事件删除临时表
///
public override void CloseReport()
{
if (customRptTempTableNames.IsNullOrEmptyOrWhiteSpace())
{
return;
}
IDBService service = Kingdee.BOS.App.ServiceHelper.GetService
//删除临时表
service.DeleteTemporaryTableName(this.Context, customRptTempTableNames);
base.CloseReport();
}
}
}
2、当我去掉统计方法GetSummaryColumnInfo时一切正常,当我增加统计方法GetSummaryColumnInfo时报如下错误:
3、不知道这是错误?如果不加统计方法GetSummaryColumnInfo那我该如何写统计方法?
推荐阅读