protected virtual void ApplyCurrentTheme(ASPxWebDocumentViewer viewer)
 {
     if (BaseXafPage.CurrentTheme != null && BaseXafPage.CurrentTheme.ToLower().Contains("black"))
     {
         viewer.ColorScheme = "dark";
     }
 }
        private ASPxWebDocumentViewer CreateASPxWebDocumentViewer()
        {
            ASPxWebDocumentViewer viewer = new ASPxWebDocumentViewer();

            viewer.ClientInstanceName = "xafReportViewer";
            //if (PopupMode) {
            //    viewer.Height = PopupWindow.GetWindowHeight();
            //}
            viewer.ClientSideEvents.Init = "viewerNewInit";
            ApplyCurrentTheme(viewer);
            return(viewer);
        }
Example #3
0
        void Application_Start(object sender, EventArgs e)
        {
            DevExpress.XtraReports.Web.WebDocumentViewer.Native.WebDocumentViewerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.Required;
            DevExpress.Web.ASPxWebControl.CallbackError += new EventHandler(Application_Error);
            ASPxWebDocumentViewer.StaticInitialize();
            //DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension.RegisterExtensionGlobal(new CustomReportStorageWebExtension());
            DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension.RegisterExtensionGlobal(new CustomReportStorageWebExtension(Server.MapPath("/Reports")));
            ASPxReportDesigner.StaticInitialize();
            ASPxWebDocumentViewer.StaticInitialize();


            System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Tls12;
        }
Example #4
0
 protected void Application_Start()
 {
     DevExpress.XtraReports.Web.QueryBuilder.Native.QueryBuilderBootstrapper.SessionState           = System.Web.SessionState.SessionStateBehavior.Disabled;
     DevExpress.XtraReports.Web.ReportDesigner.Native.ReportDesignerBootstrapper.SessionState       = System.Web.SessionState.SessionStateBehavior.Disabled;
     DevExpress.XtraReports.Web.WebDocumentViewer.Native.WebDocumentViewerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.Disabled;
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     ASPxWebDocumentViewer.StaticInitialize();
     //ASPxReportDesigner.StaticInitialize();
     DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension.RegisterExtensionGlobal(new ReportStorageWebExtension());
     DefaultReportDesignerContainer.RegisterDataSourceWizardConnectionStringsProvider <MyDataSourceWizardConnectionStringsProvider>();
 }
        protected override object CreateControlCore()
        {
            _reportsModuleV2 = ReportsModuleV2.FindReportsModule(_application.Modules);
            var reportDataType = _reportsModuleV2.ReportDataType;

            _reportData = (IReportDataV2)View.ObjectSpace.FindObject(reportDataType, CriteriaOperator.Parse("DisplayName=?", Model.ReportName));
            string handle = ReportDataProvider.ReportsStorage.GetReportContainerHandle(_reportData);

            if (_reportData == null)
            {
                throw new NullReferenceException(string.Format("Report {0} not found", Model.ReportName));
            }
            report = ReportDataProvider.ReportsStorage.LoadReport(_reportData);
            report.DataSourceDemanded += report_DataSourceDemanded;
            ASPxWebDocumentViewer viewer = CreateASPxWebDocumentViewer();

            viewer.OpenReport(report);
            return(viewer);
        }