就是点保存的时候能不能不出现这个弹出框,直接保存模版。模版名字在URL上已经有了。
点预览的时候能否实现先保存模版再加载预览数据?
因为预览的时候是根据指定参数通过接口获取数据的,所以 Startup里面Configuration是这样写的:
public void Configuration(IAppBuilder app)
{
try
{
app.UseErrorPage();
ActionFile();
var dataSetsService = new FileSystemDataSets(DataSetsRootDirectory);
var templatesService = new FileSystemTemplates(TemplatesRootDirectory);
app.Use((context, next) =>
{
context.Set(typeof(IDataSetsService).ToString(), dataSetsService);
context.Set(typeof(ITemplatesService).ToString(), templatesService);
return next.Invoke();
});
app.UseDesigner(config => config.UseFileStore(ResourcesRootDirectory, false));
app.UseReporting(settings =>
{
try
{
settings.UseCustomStore(GetReport);//使用UseCustomStore来自定义一些需要的值
settings.UseCompression = true;
SourceClass sc = new SourceClass();
settings.LocateDataSource = args =>
{
try
{
string key1 = args.Parameters[0].Value.ToString();
var ping = args.Parameters[1].Value.ToString().Split('_');
string Mould = ping[0];
string hostStrats = ping.Length == 2 ? ping[1] : "";// args.Parameters[2].Value.ToString();
string name = args.DataSet.Name;
//WriteLog.WriteLogs( name + ":********************" + key1+"请求时间:"+DateTime.Now);
GrapeCity.ActiveReports.PageReportModel.FieldCollection fields = args.DataSet.Fields;
System.Data.DataSet data1 = (System.Data.DataSet)sc.getDataSetData(name, fields, key1, Mould, hostStrats);
//WriteLog.WriteLogs( name + ":********************" + key1 + "返回时间:" + DateTime.Now);
return data1;
}
catch (Exception ex)
{
WriteLog.WriteLogs("args error 渲染出错");
WriteLog.WriteLogs(ex.ToString());
return null;
}
};
}
catch (Exception ex)
{
WriteLog.WriteLogs("settings error 渲染出错2");
WriteLog.WriteLogs(ex.ToString());
}
});
app.UseStaticFiles(new StaticFileOptions { FileSystem = new PhysicalFileSystem(String.Format(@"{0}.\wwwroot\", HttpRuntime.AppDomainAppPath)) });
}
catch (Exception ex)
{
WriteLog.WriteLogs("start error");
WriteLog.WriteLogs(ex.Message);
}
}
编辑已经存在的模版,然后保存没有问题不会弹窗;但是新建模版的时候,点保存就会弹窗,弹窗后输入模版名保存也不能保存成功
|