xtrareports-devexpress-dot-xtrareports-dot-web-dot-aspxwebdocumentviewer.md
Explicitly starts the Web Document Viewer initialization.
Namespace : DevExpress.XtraReports.Web
Assembly : DevExpress.XtraReports.v25.2.Web.WebForms.dll
NuGet Package : DevExpress.Web.Reporting
public static void StaticInitialize()
Public Shared Sub StaticInitialize
The ASPxWebDocumentViewer is automatically initialized when rendering on your application’s Web page, but in specific cases, you need to trigger its initialization explicitly (for instance, when an AppPool is recycled).
The StaticInitialize method does the following:
Use the StaticInitialize method at the application startup in the Global.asax file.
Note
To make the Document Viewer’s handlers work correctly, you should call this method after specifying the session state and registering additional services.
protected void Application_Start(Object sender, EventArgs e) {
// ...
DevExpress.XtraReports.Web.WebDocumentViewer.Native.WebDocumentViewerBootstrapper.SessionState =
System.Web.SessionState.SessionStateBehavior.Required;
// ...
DevExpress.XtraReports.Web.ASPxWebDocumentViewer.StaticInitialize();
}
Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' ...
DevExpress.XtraReports.Web.WebDocumentViewer.Native.WebDocumentViewerBootstrapper.SessionState =
System.Web.SessionState.SessionStateBehavior.Required
' ...
DevExpress.XtraReports.Web.ASPxWebDocumentViewer.StaticInitialize
End Sub
The following code snippets (auto-collected from DevExpress Examples) contain references to the StaticInitialize() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
reporting-web-mvc-email-report/CS/CustomDocumentOperationService/Global.asax.cs#L23
MVCxWebDocumentViewer.StaticInitialize();
AreaRegistration.RegisterAllAreas();
DevExpress.XtraReports.Web.WebDocumentViewer.DefaultWebDocumentViewerContainer.UseFileDocumentStorage(Server.MapPath("~/App_Data/PreviewedDocuments/"));
ASPxWebDocumentViewer.StaticInitialize();
System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Tls12;
MVCxWebDocumentViewer.StaticInitialize();
reporting-mvc-display-information-in-xrpageinfo/CS/WebDocumentViewer_UserName/Global.asax.cs#L26
System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Tls12;
MVCxWebDocumentViewer.StaticInitialize();
reporting-web-forms-view-report/CS/Global.asax.cs#L16
DefaultWebDocumentViewerContainer.Register<IReportProvider, CustomReportProvider>();
DevExpress.XtraReports.Web.ASPxWebDocumentViewer.StaticInitialize();
}
reporting-web-mvc-email-report/VB/CustomDocumentOperationService/Global.asax.vb#L26
MVCxWebDocumentViewer.StaticInitialize()
AreaRegistration.RegisterAllAreas()
DevExpress.XtraReports.Web.WebDocumentViewer.DefaultWebDocumentViewerContainer.UseFileDocumentStorage(Server.MapPath("~/App_Data/PreviewedDocuments/"))
ASPxWebDocumentViewer.StaticInitialize()
System.Net.ServicePointManager.SecurityProtocol = System.Net.ServicePointManager.SecurityProtocol Or System.Net.SecurityProtocolType.Tls12
MVCxWebDocumentViewer.StaticInitialize()
DevExpress.XtraReports.Web.ClientControls.LoggerService.Initialize(Sub(ex, message)
reporting-mvc-display-information-in-xrpageinfo/VB/WebDocumentViewer_UserName_VB/Global.asax.vb#L19
System.Net.ServicePointManager.SecurityProtocol = System.Net.ServicePointManager.SecurityProtocol Or System.Net.SecurityProtocolType.Tls12
MVCxWebDocumentViewer.StaticInitialize()
DevExpress.XtraReports.Web.ClientControls.LoggerService.Initialize(Sub(ex, message)
reporting-web-forms-view-report/VB/Global.asax.vb#L17
DefaultWebDocumentViewerContainer.Register(Of IReportProvider, CustomReportProvider)()
DevExpress.XtraReports.Web.ASPxWebDocumentViewer.StaticInitialize()
End Sub
See Also