如何使用默认缩放大小(100%)加载devexpress报表查看器

时间:2019-10-04 07:48:29

标签: reactjs asp.net-core devexpress devextreme

我有两个并行运行的项目,一个是asp.net核心应用程序,另一个是react应用程序,通过使用backend(asp.net core)url iam loading 前端React应用程序中的devexpress报表查看器, 因此默认情况下,报表查看器正在加载自动缩放大小,因此...

我的要求是,我想在前端react应用程序上以默认缩放大小100%加载devexpress报告查看器。 如何实现

我在viewer.cshtml的后端(asp.net核心应用程序)中添加了以下代码 但这仅反映在后端项目上,如何在前端反应应用程序中做到这一点?

@Html.DevExpress().WebDocumentViewer("DocumentViewer").ClientSideEvents(a => a.BeforeRender("function(s, e) { s.GetPreviewModel().reportPreview.zoom(1); }")).Height("100%").Width("100%").Bind(ViewData["ReportName"].ToString());

反应前端报告查看器类如下所示,它消耗了其他组件中的以下类,因此在加载时如何将默认缩放尺寸设置为100%并加载????

  constructor(props) {
      super(props);
      this.reportUrl = ko.observable(props.reportUrl);
      const host = getDevExpressReportUrl();

      this.requestOptions = {
        host,
          // Use this line if you use an ASP.NET MVC backend 
          // invokeAction: "WebDocumentViewer/Invoke" 
          // Uncomment this line if you use an ASP.NET Core backend 
           invokeAction: "SomePatternHere" 

      };
  }
  render() {
      return (
      <div ref="viewer" data-bind="dxReportViewer: $data">   
      </div>
      );
  }
}

0 个答案:

没有答案