public class CaiGouGangLiaoService : SysReportBaseService
{
// 初始化事件:在此事件中,设置报表基本属性
public override void Initialize()
{
base.Initialize();
// 简单账表类型:普通、树形、分页
this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;
// 报表名称
this.ReportProperty.ReportName = new LocaleValue("备库钢料到货和消耗报表", base.Context.UserLocale.LCID);
//
this.IsCreateTempTableByPlugin = true;
//
this.ReportProperty.IsUIDesignerColumns = false;
//
this.ReportProperty.IsGroupSummary = true;
//
this.ReportProperty.SimpleAllCols = false;
// 单据主键:两行FID相同,则为同一单的两条分录,单据编号可以不重复显示
//this.ReportProperty.PrimaryKeyFieldName = "FID";
//
this.ReportProperty.IsDefaultOnlyDspSumAndDetailData = true;
}
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)//表名
{
base.BuilderReportSqlAndTempTable(filter, tableName);
// 拼接过滤条件 : filter
DynamicObject dyFilter = filter.FilterParameter.CustomFilter;//快捷页签过滤条件
var strMingCheng = ObjectUtils.Object2String(dyFilter["字段标识"]);//过滤日期-开始
var strMingCheng2 = ObjectUtils.Object2String(dyFilter["字段标识"]);//过滤日期-结束
// 默认排序字段:需要从filter中取用户设置的排序字段
string seqFld = string.Format(base.KSQL_SEQ, " fbillno ");
string sql = "select * from A";
//更新单价()
DBUtils.Execute(base.Context, sql);
}
//拼接报表展示标题&格式
public override ReportHeader GetReportHeaders(IRptParams filter)
{
ReportHeader header = new ReportHeader();
var status = header.AddChild("采购申请日期", new LocaleValue("采购申请日期"));
var billNo = header.AddChild("单据编码", new LocaleValue("单据编号"));
header.AddChild("订单号", new LocaleValue("订单号"));
header.AddChild("评审号", new LocaleValue("评审号"));
return header;
}
//给过滤条件赋值
public override ReportTitles GetReportTitles(IRptParams filter)
{
var result = base.GetReportTitles(filter);
DynamicObject dyFilter = filter.FilterParameter.CustomFilter;
if (dyFilter != null)
{
if (result == null)
{
result = new ReportTitles();
}
//result.AddTitle("字段标识", "2023-1-12");//这个是我的日期字段
}
return result;
}
/**
* 每页汇总行
* */
public override List<SummaryField> GetSummaryColumnInfo(IRptParams filter)
{
var result = base.GetSummaryColumnInfo(filter);
result.Add(new SummaryField("库存数量", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
result.Add(new SummaryField("计价数量", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
result.Add(new SummaryField("库存计价数量", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
result.Add(new SummaryField("库存金额", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
return result;
}
}
推荐阅读