Current filter:
                                You should refresh the page.
                                Support Center

                                This example illustrates how to make the ASPxDocumentViewer store its document on the client between postbacks.

                                Upon the request to preview, export, or print the document, the Document Viewer restores it from the Page cache, instead of performing a round trip to the server, requesting for a new document copy.

                                The Document Viewer manages a cached document during the CacheReportDocument and RestoreReportDocumentFromCache events.

                                For an MVC approach to solving this task, see How to use the built-in caching functionality of the ASP.NET MVC Document Viewer.

                                Note: No document caching is required when using the newer ASPxWebDocumentViewer control that utilizes the HTML5/JS technology and provides asynchronous building of documents out of the box.

                                • Luigi Renzi 04.02.2013

                                  How can it be possible to translate this sample to work with ReportViewerExtension in Asp.Net MVC?
                                  How to get access to the underlying ReportViewer to wire up CacheReportDocument and RestoreReportDocumentFromCache events?

                                • Adam Caviness 01.28.2014

                                  According to this code, a new report instance is created on all postbacks. Was that really the intent of this new caching functionality? What about reports that use runtime data binding? I thought instantiating the report is what I'm trying to avoid.

                                • Hi Adam,
                                  There is nothing wrong in that the new XtraReport class instance is created. Please note that the report document isn't generated multiple times: only the report class instance is created. If you are using the Page_Load event to initialize the report data source, I suggest that you move this routine to the XtraReport.BeforePrint or DataSourceDemanded event handler.

                                • Hi Luigi,
                                  Please review the in this regard.

                                • Adam Caviness 01.30.2014

                                  @Alex, thanks for the explanation and tip on DataSourceDemanded.

                                • You are always welcome, Adam!

                                Show Implementation Details
                                Select file
                                • Default.aspx
                                • Default.aspx.cs
                                • XtraReport1.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • 13.2.5 - 17.1.7
                                • 11.1.6 - 13.1.12
                                • 9.1.9 - 11.1.5

                                If you need additional product information, write to us at or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners