先前帮客户开发了Cloud5版本的功能,在安装了最近的补丁后,发现了以下问题:
1. 第一次部署发现“应收款明细表”只会显示一列,即“真实发票号”,但是在打上补丁后该问题自动修复了,然后客户又安装了最新的补丁,发现这个问题又出来了,下面是开发的应收款明细表的代码:
public class CustomArDetailReportService : ARDetailReportService
{
Stack
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
var originFilterString = filter.FilterParameter.FilterString;
//filter.FilterParameter.FilterString = originFilterString.ReplaceCommonFilterString();
var dbService = ServiceHelper.GetService
_tempTables.Push(dbService.CreateTemporaryTableName(Context, 1)[0]);
base.BuilderReportSqlAndTempTable(filter, _tempTables.Peek());
var sb = new StringBuilder();
// SQL语句
var sql = "/*dialect*/Select t1.*,t2.FREALIV Into {0} From {1} t1 Left Join dbo.T_AR_RECEIVABLE t2 on t1.FBILLNO = t2.FBILLNO";
//sb.AppendFormat(sql, tableName, _tempTables.Peek(), string.IsNullOrWhiteSpace(originFilterString) ? string.Empty : "Where " + originFilterString.RetriveCommonFilterString());
sb.AppendFormat(sql, tableName, _tempTables.Peek());
DBUtils.Execute(Context, sb.ToString());
}
public override ReportHeader GetReportHeaders(IRptParams filter)
{
var result = base.GetReportHeaders(filter);
result.AddChild("FREALIV", new LocaleValue("真实发票号"));
return result;
}
public override ReportTitles GetReportTitles(IRptParams filter)
{
var header = base.GetReportTitles(filter);
header.AddTitle("FREALIV", "真实发票号");
return header;
}
public override void CloseReport()
{
if (_tempTables.Count() == 0)
{
return;
}
var dbService = ServiceHelper.GetService
dbService.DeleteTemporaryTableName(Context, _tempTables.ToArray());
base.CloseReport();
}
}
2. 在“应收款账龄分析表”里面,我新增加了一列“真实发票号”,这个新增的功能很简单的,展示出来也正常,但是在导出时候提示以下错误:
我完全不知道这个错误是由什么引起的,相关的代码如下:
public class CustomAgingAnalysisService : AgingAnalysisService
{
Stack
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
var originFilterString = filter.FilterParameter.FilterString;
var dbService = ServiceHelper.GetService
_tempTables.Push(dbService.CreateTemporaryTableName(Context, 1)[0]);
base.BuilderReportSqlAndTempTable(filter, _tempTables.Peek());
var sql = "/*dialect*/Select t1.*,t2.FREALIV Into {0} From {1} t1 Left Join dbo.T_AR_RECEIVABLE t2 on t1.FBILLNO = t2.FBILLNO";
DBUtils.Execute(Context, string.Format(sql, tableName, _tempTables.Peek()));
}
public override ReportHeader GetReportHeaders(IRptParams filter)
{
var result = base.GetReportHeaders(filter);
result.AddChild("FREALIV", new LocaleValue("真实发票号"));
return result;
}
public override ReportTitles GetReportTitles(IRptParams filter)
{
var header = base.GetReportTitles(filter);
header.AddTitle("FREALIV", "真实发票号");
return header;
}
public override void CloseReport()
{
if (_tempTables.Count() == 0)
{
return;
}
var dbService = ServiceHelper.GetService
dbService.DeleteTemporaryTableName(Context, _tempTables.ToArray());
base.CloseReport();
}
}
以上,还望老师解答,多谢!