fumasoft 发表于 2023-2-8 13:37:58

怎样让AR16模版编辑保存时不弹窗



就是点保存的时候能不能不出现这个弹出框,直接保存模版。模版名字在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.Value.ToString();
                              var ping = args.Parameters.Value.ToString().Split('_');
                              string Mould = ping;
                              string hostStrats = ping.Length == 2 ? ping : "";// args.Parameters.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);
            }
      }

编辑已经存在的模版,然后保存没有问题不会弹窗;但是新建模版的时候,点保存就会弹窗,弹窗后输入模版名保存也不能保存成功

Felix.Li 发表于 2023-2-8 13:37:59

fumasoft 发表于 2023-2-8 14:14
可以 已经私信你了
使用:

grapecity.activereports.webdesigner.renderapplication("designer-id1", designeroptions).then((result) => {
      result.documents.save = () => {
         result.documents.saveByName("name")
}
})
即可

Felix.Li 发表于 2023-2-8 14:02:54

您看方便远程一下吗,具体问题从代码中好看

fumasoft 发表于 2023-2-8 14:14:52

Felix.Li 发表于 2023-2-8 14:02
您看方便远程一下吗,具体问题从代码中好看

可以 已经私信你了

wengMQ 发表于 2023-2-9 10:33:14

【新提醒】Web端在线设计器项目实际分享 - ActiveReports专区 - 专题教程 - 葡萄城产品技术社区https://gcdn.grapecity.com.cn/forum.php?mod=viewthread&tid=144262&extra=page%3D1

Eden.Sun 发表于 2023-2-9 10:50:10

wengMQ 发表于 2023-2-9 10:33
【新提醒】Web端在线设计器项目实际分享 - ActiveReports专区 - 专题教程 - 葡萄城产品技术社区https://g ...

:hjyzw:

fumasoft 发表于 2023-2-9 19:56:44

Felix.Li 发表于 2023-2-8 18:21
使用:




这个方法AR15的脚本里面没有吗?如果是AR15,需要保存不弹窗怎么处理呢?


Eden.Sun 发表于 2023-2-10 09:19:59

fumasoft 发表于 2023-2-9 19:56
这个方法AR15的脚本里面没有吗?如果是AR15,需要保存不弹窗怎么处理呢?

AR 15 中也是有的,

https://www.grapecity.com/activereportsnet/docs/versions/v15/online/web-designer-plugins-api.html

页: [1]
查看完整版本: 怎样让AR16模版编辑保存时不弹窗