提交 85fe30bb authored 作者: 谭富强's avatar 谭富强

1

上级 6b1bb8af
...@@ -1148,6 +1148,20 @@ UPDATE SET ...@@ -1148,6 +1148,20 @@ UPDATE SET
rptParam.CustomParams.Add(KeyConst.OPENPARAMETER_KEY, openParameter); rptParam.CustomParams.Add(KeyConst.OPENPARAMETER_KEY, openParameter);
rptParam.ParameterData = parameterData; rptParam.ParameterData = parameterData;
MoveReportServiceParameter param = new MoveReportServiceParameter(ctx, reportMetadata.BusinessInfo, Guid.NewGuid().ToString(), rptParam); MoveReportServiceParameter param = new MoveReportServiceParameter(ctx, reportMetadata.BusinessInfo, Guid.NewGuid().ToString(), rptParam);
string checkTableSql = @"SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Detailreports'";
var result = DBUtils.ExecuteDynamicObject(this.Context, checkTableSql);
// 检查 result 是否为空,并获取 count 值
if (result != null && result.Count > 0)
{
var firstRow = result[0]; // 获取结果集中的第一行
int tableCount = firstRow["Property0"] != null ? Convert.ToInt32(firstRow["Property0"]) : 0;
// 如果表存在,则删除
if (tableCount > 0)
{
string sqlDROP = @"DROP TABLE Detailreports";
DBUtils.ExecuteDynamicObject(this.Context, sqlDROP);
}
}
using (DataTable dt = sysReporSservice.GetListAndReportData(param).DataSource) using (DataTable dt = sysReporSservice.GetListAndReportData(param).DataSource)
{ {
if (dt == null || dt.Rows.Count == 0) if (dt == null || dt.Rows.Count == 0)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论