业务需求:二开产品报表,专项新增列,并隐藏继承的基类的指定列
public override ReportHeader GetReportHeaders(IRptParams filter)
{
ReportHeader reportHeader = base.GetReportHeaders(filter);//获取到基类的所有列
List<string> hiddenField = new List<string>() { "FSTARTORGVALUE","FSTARTACCDEPR",
"FSTARTNETVALUE","FCURRENTORGVALUEADD",
"FCURRENTORGVALUEREDUCE","FCURRENTACCDEPRADD",
"FCURRENTACCDEPRREDUCE","FCURRENTDEPR",
"FCURRENTYEARACCDEPR","FENDORGVALUE","FENDACCDEPR","FENDNETVALUE" };
var childs = reportHeader.GetChilds();
foreach (var item in childs)
{
var fieldName = item.FieldName;
if (hiddenField.Contains(fieldName))
{
item.Visible = false;//设置列隐藏
}
}
reportHeader.AddChild("FASSETGROUPNAME", new LocaleValue("资产类别分组"));
reportHeader.AddChild("FBRANDS", new LocaleValue("品牌"));
reportHeader.AddChild("FSTOCKNAME", new LocaleValue("仓库"));
reportHeader.AddChild("FALLOAMOUNT", new LocaleValue("分配金额(元)")).ColType = SqlStorageType.SqlMoney;
reportHeader.AddChild("FALLOACCDEPR", new LocaleValue("分配累计折旧(元)")).ColType = SqlStorageType.SqlMoney;
reportHeader.AddChild("FUNITNAME", new LocaleValue("单位"));
reportHeader.AddChild("FQUANTITY", new LocaleValue("数量")).ColType = SqlStorageType.SqlNumeric;
reportHeader.AddChild("FBEGINUSEDATE", new LocaleValue("启用日期"));
reportHeader.AddChild("FDISPOSALTYPE", new LocaleValue("处置情况"));
reportHeader.AddChild("FENDORGVALUE1", new LocaleValue("设备原值(元)")).ColType = SqlStorageType.SqlMoney;
reportHeader.AddChild("FENDACCDEPR1", new LocaleValue("累计折旧(元)")).ColType = SqlStorageType.SqlMoney;
reportHeader.AddChild("FENDNETVALUE1", new LocaleValue("设备净值(元)")).ColType = SqlStorageType.SqlMoney;
reportHeader.AddChild("FSPECIFICATION", new LocaleValue("规格型号"));
reportHeader.AddChild("FSUPNAME", new LocaleValue("供应商"));
reportHeader.AddChild("FMANUFACTURER", new LocaleValue("生产厂商"));
return reportHeader;
}