Current filter:
                                You should refresh the page.
                                  • By default, XAF Mobile Beta does not have a report preview function. Users can only export a document into a file (PDF, Excel, CSV, etc.) and download it. This article demonstrates how to enable the Report Viewer that allows users to browse XtraReports in XAF mobile applications. This feature is based on the HTML5 Document Viewer and uses its Mobile Mode.

                                    UPDATED:
                                    The step with a separate ReportsResolver filewas removed.

                                    Prerequisites
                                    Install any v17.2.7+ version.
                                    Add the ReportsMobileModuleV2 module to the Mobile application (Ways to Register a Module).

                                    Note: Starting with v18.1, the feature and the instructions will be optimized.

                                    Steps to implement
                                    1. You need to register XafReportsResolver  - a data service used for preparing reports on the server side and sending the report content to a mobile client. For this, open the YourApplication.Mobile/Global.asax.cs(vb) file and find the Application_Start method (if this method does not exist, copy the code provided below). In the method body, call the DefaultWebDocumentViewerContainer > Register<T, TImpl> method passing the XafReportsResolver<YourMobileApplicationMobileApplication>  class as a generic parameter. Add the DevExpress.ExpressApp.ReportsV2.Mobile and DevExpress.XtraReports.Web.WebDocumentViewer using (Imports in VB.NET) directives to the beginning of the Global.asax file, and add a reference to the DevExpress.XtraReports.vXX.X.dll assembly to the References node in the Solution Explorer.

                                    [C#]
                                    //.. using DevExpress.ExpressApp.ReportsV2.Mobile; using DevExpress.XtraReports.Web.WebDocumentViewer; namespace YourApplication.Mobile { public class Global : System.Web.HttpApplication { protected void Application_Start(Object sender, EventArgs e) { //.. DefaultWebDocumentViewerContainer.Register<IWebDocumentViewerReportResolver, XafReportsResolver<YourMobileApplicationMobileApplication>>(); } } }
                                    [VB.NET]
                                    '.. Imports DevExpress.ExpressApp.ReportsV2.Mobile Imports DevExpress.XtraReports.Web.WebDocumentViewer Namespace YourApplication.Mobile Public Class [Global] Inherits System.Web.HttpApplication Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) '.. DefaultWebDocumentViewerContainer.Register(Of IWebDocumentViewerReportResolver, XafReportsResolver(Of YourMobileApplicationMobileApplication))() End Sub End Class End Namespace

                                    2. To enable the execution of Report Scripts in your mobile application, register a ScriptPermissionManager instance in the Application_Start method mentioned in the previous paragraph. Refer to the following article for details: BC3759 - Web Report Designer - Report scripts have been disabled by default. After all modifications, the code in the Global.asax method should look as follows:

                                    [C#]
                                    //.. using DevExpress.ExpressApp.ReportsV2.Mobile; using DevExpress.XtraReports.Security; using DevExpress.XtraReports.Web.WebDocumentViewer; namespace YourApplication.Mobile { public class Global : System.Web.HttpApplication { protected void Application_Start(Object sender, EventArgs e) { //.. ScriptPermissionManager.GlobalInstance = new ScriptPermissionManager(ExecutionMode.Unrestricted); DefaultWebDocumentViewerContainer.Register<IWebDocumentViewerReportResolver, XafReportsResolver<YourMobileApplicationMobileApplication>>(); } } }
                                    [VB.NET]
                                    '.. Imports DevExpress.ExpressApp.ReportsV2.Mobile Imports DevExpress.XtraReports.Security Imports DevExpress.XtraReports.Web.WebDocumentViewer Namespace YourApplication.Mobile Public Class [Global] Inherits System.Web.HttpApplication Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) '.. ScriptPermissionManager.GlobalInstance = new ScriptPermissionManager(ExecutionMode.Unrestricted) DefaultWebDocumentViewerContainer.Register(Of IWebDocumentViewerReportResolver, XafReportsResolver(Of YourMobileApplicationMobileApplication))() End Sub End Class End Namespace

                                    3.  Register the Mobile Reports HTTP Handler in the application configuration file. Open the YourApplication.Mobile/Web.config file and add the following record to the system.webServer/handlers section. If you are using a newer DevExpress version, modify the Version attribute accordingly.

                                    [XML]
                                    <!-- .. --> <configuration> <!-- .. --> <system.webServer> <!-- .. --> <handlers> <!-- .. --> <add name="Reports" verb="GET,POST" path="ReportsHandler*" type="DevExpress.ExpressApp.ReportsV2.Mobile.ReportsHandler, DevExpress.ExpressApp.ReportsV2.Mobile.v17.2, Version=17.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> </handlers> </system.webServer> </configuration>

                                    4. To enable the Mobile Report Viewer, double-click the YourApplication.Mobile\MobileApplication.cs(vb) file. Select the ReportsMobileModuleV2 module in the Application Designer and change the EnableReportViewer property value to true.

                                    Run the mobile application, navigate to the Report_ListView, and tap any record. The DetailView displaying the report content should be opened.

                                • Scott Gross 04.05.2018

                                  It works!

                                • Dennis (DevExpress) 04.05.2018

                                  :-)

                                • Phan Sin Tian 05.14.2018

                                  o enable the Mobile Report Viewer, double-click the YourApplication.Mobile\MobileApplication.cs(vb) file. Select the ReportsMobileModuleV2 module in the Application Designer and change the EnableReportViewer property value to true.

                                  I cannot find where to   EnableReportViewer property value to true

                                • Phan Sin Tian 05.14.2018

                                  Found, Please ignore my previous post

                                0 Solutions

                                Creation Date Importance Sort by