应收款明细报表加一个字段后无法正常显示 服务插件代码如下
namespace cqDev.yskhzbb.plusin
{
public class YskhzbbPlusin :Kingdee.K3.FIN.AR.App.Report.ARDetailReportService
{
publicoverride void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
string tablenameExt = GetTableName();
base.BuilderReportSqlAndTempTable(filter, tablenameExt);
string xsqdtable = "SELECT fentryid,fdatavalue into #xsqd FROM(SELECT t0.FID fid_id, t0.FNUMBER fnumber,st01_L.FNAME FName, t0_L.FDATAVALUEfdatavalue, t0.FDOCUMENTSTATUS fdocumentstatus, t0.FISSYSPRESET fissyspreset,t0.FFORBIDSTATUS fforbidstatus, t0.FENTRYID fentryid, t0.FMASTERID fmasterid,ROW_NUMBER() OVER( ORDER BY st01_L.FNAME ASC, t0.FSEQ ASC, t0.FNUMBER ASC,t0_L.FDATAVALUE ASC) fidentityid FROM T_BAS_ASSISTANTDATAENTRY t0 LEFT OUTERJOIN T_BAS_ASSISTANTDATAENTRY_L t0_L ON (t0.FENTRYID = t0_L.FENTRYID ANDt0_L.FLocaleId = 2052) LEFT OUTER JOIN T_BAS_ASSISTANTDATA_L st01_L ON (t0.FID= st01_L.FID AND st01_L.FLocaleId = 2052) WHERE (t0.FID IN (SELECT fid FROMt_bas_assistantdata) AND st01_L.FNAME = N'客户类别')) tlist";
string dropxsqd = " drop table #xsqd";
string droptable = " drop table " + tablenameExt;
// TODO:关联查询,并将结果更新到tablename表,以下仅供参考
string strSql = string.Format(" select A.*,(select top 1#xsqd.fdatavalue from T_BD_CUSTOMER T1 inner join T_BD_CUSTOMER_L T2 onT1.FCUSTID=T2.FCUSTID left join #xsqd on T1.FCUSTTYPEID=#xsqd.fentryid whereT1.FNUMBER=A.FCONTACTUNITNUMBER and t2.FNAME =A.FCONTACTUNITNAME) asF_cq_xsqd into {0} from {1} as A ", tableName, tablenameExt);
DBUtils.Execute(this.Context, xsqdtable + strSql + dropxsqd + droptable);
}
publicoverride ReportHeader GetReportHeaders(IRptParams filter)
{
ReportHeader header = base.GetReportHeaders(filter);
// TODO: 添加新增字段
header.AddChild("F_cq_xsqd", new LocaleValue("F_cq_xsqd",this.Context.UserLocale.LCID));
return header;
}
}
}
BOS配置如下
重启iis后登录查询结果如下
之前的字段都没显示出来。
这种方式修改了销售出库汇总报表都可以正常显示。不知道为什么应收款明细和应收款汇总表就不行了。
加我QQ735898499,远程看一下 非常感谢!
推荐阅读