销售出库明细报表,添加了一个字段'库存基本数量';
重载了系统默认的字段,但是账表里面没有显示这个字段;
源代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Contracts;
using Kingdee.BOS.Util;
using Kingdee.K3.SCM.App.Sal.Report;
using Kingdee.BOS;
namespace salceshi
{
public class Class1 : SaleOutStockDetailRpt
{
private string[] customRptTempTableNames;
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
IDBService dbservice = Kingdee.BOS.App.ServiceHelper.GetService
customRptTempTableNames = dbservice.CreateTemporaryTableName(this.Context, 1);
string strTable = customRptTempTableNames[0];
base.BuilderReportSqlAndTempTable(filter, strTable);
StringBuilder sb = new StringBuilder();
string strSql = "select t1.*,a1.FBASEUNITQTY into {0} from {1} t1 left join T_SAL_OUTSTOCKENTRY a1 on t1.fid=a1.fid and t1.fentryid=a1.Fentryid ";
sb.AppendFormat(strSql, tableName, strTable);
DBUtils.Execute(this.Context, sb.ToString());
}
public override void CloseReport()
{
if (customRptTempTableNames.IsNullOrEmptyOrWhiteSpace())
{
return;
}
IDBService dbservice = Kingdee.BOS.App.ServiceHelper.GetService
dbservice.DeleteTemporaryTableName(this.Context, customRptTempTableNames);
base.CloseReport();
}
public override ReportHeader GetReportHeaders(Kingdee.BOS.Core.Report.IRptParams filter)
{
ReportHeader header = base.GetReportHeaders(filter);
header.AddChild("FBASEUNITQTY", new LocaleValue("库存基本数量"));
return header;
}
}
}
请问是不是还有别的地方需要设置,或者是代码还有哪里有问题
推荐阅读