Current filter:
                                You should refresh the page.
                                  • Hi,

                                    We cannot print on the specifically only chrome, the firefox is ok.

                                    Chrome Version: 71.0.3578.98

                                    What are the possible reasons for this error?

                                    Thanks.
                                • Yuanjie Liu 12.18.2018
                                  In addition, Our DevExpress Control Version is 18.1.6. Accounting to the user reports this issue doesn't happen to everyone.

                                  Thanks.
                                • Yuanjie Liu 12.18.2018
                                  I found this error can reproduce on the IE and firefox browser. I think this error has nothing to do with the browser. When this error happens, this issue did improve once the w3wp.exe processes were recycled, but this issue repeats itself about 2 hours after the recycle.

                                  Where should I look for the reason?

                                  Thanks. 

                                1 Solution

                                Creation Date Importance Sort by

                                Hello,

                                As far as I understand, you get this error in any browser if you recycle the AppPool. It looks like the same issue was discussed in the Web Document Viewer - It is impossible to recreate a report after the AppPool is recycled ticket. Please review it to learn why the error occurs after the AppPool is restarted or recycled. Also, in that thread, you will find recommendations on how to resolve this issue. Please check both solutions provided in the ticket and let us know your results.

                                Show all comments
                                • Yuanjie Liu 12.19.2018
                                  Sorry, it's not like that you say.

                                  When happening this error, we recycle the AppPool then the print works well, but after 2 hours, this error reappear. 

                                  Thanks.
                                • Yuanjie Liu 12.19.2018
                                  I think there is a memory issue for the print.
                                • Andrey (DevExpress Support) 12.19.2018

                                  Hello,
                                  Thank you for the clarification. Unfortunately, this information is insufficient to precisely figure out why this happens. Please perform the following actions to allow us to determine a possible cause of this behavior: 

                                  - Register LoggerService that will log all server-side exceptions thrown when a report document is being created.
                                  - Reproduce the issue and share the results of your logger service along with a Network panel screenshot (the response status code of our internal "DXXRDV.axd" HTTP handlers).

                                  - Provide us with your report definition (an REPX file). See the Saving Report Layouts help topic to learn how to create an REPX file.
                                  - Specify how many pages the generated document can contain.

                                  I look forward to your response.

                                • Yuanjie Liu 12.19.2018
                                  This screenshot is from chrome debug.
                                • Vasily (DevExpress Support) 12.19.2018

                                  Hi Yuanjie,

                                  Let me chime in while Andrey is out of the office. I have reviewed this thread and it looks like the behavior you faced may be caused by our HTML5 Document Viewer component architecture specifics. That is because the Web Document Viewer stores the previewed document in an in-memory cache by default. And this cache expires after two hours. So, would you please clarify whether the document appears again if you refresh the web page after 2 hours?

                                  This also explains why the  'Cannot create document for the current report' error occurs after recycling an AppPool: The memory cache is cleaned during the AppPool recycle, so the HTML5 Document Viewer component cannot recreate the report's document again because the opened report layout is missing in the memory cache. To resolve this issue, you can try opening reports by names via the Bind(string reportUrl) method, instead of opening a report by an instance. To use this approach, it is also necessary to implement a Report Storage that will be used to load reports by names. You can also check the Web Document Viewer - It is impossible to recreate a report after the AppPool is recycled thread where a similar issue was already discussed,

                                • Yuanjie Liu 12.19.2018
                                  Hi Vasily,

                                  Thank you for your replay!

                                  We will use a file cache instead of using in-memory cache, implement this use the UseFileDocumnetStorage property.
                                  If we have a load balancing server before the application server, do have other issues by using the file cache?

                                  Thanks. 
                                • Vasily (DevExpress Support) 12.20.2018
                                  Hi Yuanjie,

                                  >>We will use a file cache instead of using in-memory cache, implement this use the UseFileDocumnetStorage property.
                                  So, would you please clarify whether using a file storage resolved your original issue?

                                  >>If we have a load balancing server before the application server, do have other issues by using the file cache?
                                  To make our viewer component operate correctly in a load-balanced environment (a.k.a. Web Farm) it is necessary to perform the adjustments that are described in the HTML5 Document Viewer and Report Designer's Preview part of the  Web Farms and Web Garden Support help topic. These adjustments are required to synchronize the reports cache on each instance of your Web Farm.
                                  Alternatively, you can just enable the Session Affinity option to make requests coming from each particular client be handled by the same instance of your Web Farm.
                                • Yuanjie Liu 12.20.2018
                                  Thank for your replay.

                                  The first question, we test on our production environment, so I still unknown now.

                                  If we have a load balancing server and want to use the file system to store the preview cache files, so we need a shared folder for all the web application server have read/write permission.

                                  I use the way that enables the Session Affinity option at present. But we want to use a true load balancing, this way does not work for us.

                                  Thanks.
                                • Vasily (DevExpress Support) 12.21.2018

                                  Hi Yuanjie,

                                  Thank you for your update. If you do not want to enable the Session Affinity option just use a shared storage as described in the HTML5 Document Viewer and Report Designer's Preview part of the Web Farms and Web Garden Support help topic. In this case our reporting components should operate correctly in your load balanced environment.

                                • Yuanjie Liu 01.10.2019
                                  Hello,

                                  Today we deploy the project to production, This issue 'Cannot create a document for the current report' is more frequent. I used the way UseFileDocumnetStorage to implement.

                                  I add the following code and call it in Applicaton_start method in the Global.asax.cs.
                                  [C#]
                                  private void SetWebDocumentViewer(string fileStore, TimeSpan timeToLive) { var fileCachePath = Path.Combine(fileStore, "DocumentPreviewCache"); DefaultWebDocumentViewerContainer.UseFileDocumentStorage(fileCachePath); DefaultWebDocumentViewerContainer.UseFileExportedDocumentStorage(fileCachePath); DefaultWebDocumentViewerContainer.UseFileReportStorage(fileCachePath); var timeToLive = WebUtils.WebDocumentViewerTimeToLive; DefaultWebDocumentViewerContainer.RegisterSingleton<CacheCleanerSettings>(new CustomCacheCleanerSettings(timeToLive)); DefaultWebDocumentViewerContainer.RegisterSingleton<StoragesCleanerSettings>(new CustomStoragesCleanerSettings(timeToLive)); }
                                  This issue occurs in a random. Once this happens, open the other reports also do not work well.

                                  I hope you can help me to find out why?

                                  Thank you so much.
                                • Vasily (DevExpress Support) 01.11.2019

                                  Hi Yuanjie,

                                  Would you please clarify what code you are using to preview reports in your application? Are you passing an XtraReport class instance to the WebDocumentViewer extension or a report name to it ("reportUrl")?  Take special note that the Bind(String) method should be used to open reports in your application when it is used on a Web Farm.

                                • Yuanjie Liu 01.11.2019
                                  Hello,
                                  I implement code as following,
                                  [C#]
                                  // Model public class RegularReportViewModel{ public XtraReport Report { get; set; } } // DetailReportPartial.cshtml @model RegularReportViewModel @Html.DevExpress().WebDocumentViewer(settings => { settings.Name = "WebDocumentViewer1"; ... }).Bind(Model.Report).GetHtml()
                                  We do not use a Web Farm.
                                • Vasily (DevExpress Support) 01.14.2019

                                  Hi Yuanjie,

                                  >>We do not use a Web Farm.
                                  In your earlier comments you mentioned that you were using load balancing environment. This kind of environment is called Web Farm so your last statement sounds confusing to me. So, would you please clarify whether you are still using load-balanced environment? If so, the code that you are using to open reports is not correct. The Bind(String) method should be used to open reports in your application, so the XtraReport typed field in your model should be replaced with a string:

                                  [C#]
                                  public class RegularReportViewModel{ public string Report { get; set; } }

                                   

                                  Then implement the ICachedReportSourceWebResolver interface to associate the report's unique name that was passed to the Bind(String) method with a CachedReportSourceWeb object that possesses the corresponding report. Check the steps provided in the HTML5 Document Viewer and Report Designer's Preview part of the Web Farms and Web Garden Support help topic for more information. Take special note that all the steps provided in that help topic are required to make the report preview operate correctly.

                                • Yuanjie Liu 01.14.2019
                                  Thank you very much.

                                  I have a load balancing, but we use the  Session Affinity option at present. We want to replace in the future.
                                  We use the following code to load a report,
                                  [C#]
                                  Model.Report = XtraReport.FromStream(stream, true) ?? XtraReport.FromFile("Report.repx")
                                  In this case, is there a problem with our implementation?

                                  I want to know does the report use the session? I found sometimes our load balancing have trouble for the request whether cause this issue.

                                  Why do we need to use the Bind(string)?

                                  Thanks.
                                • Yuanjie Liu 01.14.2019
                                  Because we upgrade the report form DocumentViewer to WebDocumentViewer, we keep the old way.
                                  In our system, we have the following two kinds of reports,

                                  1. The system report saves as .repx.
                                  2. We have a lot of custom report and save in the Database as byte[]. 

                                  So we load the report as follow,
                                  [C#]
                                  Model.Report = XtraReport.FromStream(stream, true) ?? XtraReport.FromFile("Report.repx")
                                  I have seen the demo project MVCxReportDemos, in the code uses the Session, Cache, and File on the report, let me feel confused.

                                  How do we do this? Could you give me a simple Demo?

                                  Thanks.
                                • Vasily (DevExpress Support) 01.15.2019

                                  Hi Yuanjie,

                                  >>I have a load balancing, but we use the  Session Affinity option at present.
                                  The fact that the "Cannot create document for the current report" error occurs on your side makes me think that either Session Affinity works not as expected in some cases or the server memory was cleared. In fact, when you create an XtraReport class instance, this report is stored in the web server's in-memory cache. The "Cannot create document for the current report" error occurs because the viewer was not able to find the report instance in this cache. You need to find the report instance to be able to recreate the report document. So, this issue may be caused by the fact that the server memory was cleared along with the in-memory cache, or a request to the server was handled by another instance of your web farm (not by the instance where your XtraReport object was created). 

                                  >>In this case, is there a problem with our implementation?
                                  >>Why do we need to use the Bind(string)?

                                  Your current implementation makes the viewer work with the report instance that is stored in the web server's memory. Switching to the Bind(string) method will give the viewer a possibility to request the report by its name if the report was not found in the in-memory cache. The report will be requested by its name from the ICachedReportSourceWebResolver class in this case. 

                                  >>I want to know does the report use the session? I found sometimes our load balancing have trouble for the request whether cause this issue.
                                  No, our reporting components do not use the session. Yet, the reason why the Session does not work in a load balanced environment is the same - the session is an in-memory storage, so each instance of your Web Farm has its own session storage that is not synchronized with other web servers.

                                  >>How do we do this? Could you give me a simple Demo?
                                  To accomplish this task, just create a class that implements the ICachedReportSourceWebResolver interface in your application and move your report loading code to the class method. For example, use the following code:

                                  [C#]
                                  public class CustomCachedReportSourceWebResolver : ICachedReportSourceWebResolver { public bool TryGetCachedReportSourceWeb(string reportName, out CachedReportSourceWeb cachedReportSourceWeb) { try { XtraReport report = XtraReport.FromStream(stream, true) ?? XtraReport.FromFile(reportName); cachedReportSourceWeb = new CachedReportSourceWeb(report); return true; } catch { cachedReportSourceWeb = null; return false; } } }

                                   

                                  Then register this class in the Application_Start event handler:

                                  [C#]
                                  protected void Application_Start() { DefaultWebDocumentViewerContainer.Register<ICachedReportSourceWebResolver, CustomCachedReportSourceWebResolver>(); ... }

                                   

                                  Finally, use the following code to open the report:

                                  [C#]
                                  @Html.DevExpress().WebDocumentViewer(settings => { settings.Name = "WebDocumentViewer1"; ... }).Bind("Report.repx").GetHtml()

                                   

                                  Take special note that the string parameter that is passed to the Bind method will be passed to the TryGetCachedReportSourceWeb method as the "reportName" parameter.

                                • Yuanjie Liu 01.15.2019
                                  Thank you very much.

                                  I will try your suggestion in our system. I want to know whether the code above has some conflicts with the following code
                                  [C#]
                                  private void SetWebDocumentViewer(string fileStore, TimeSpan timeToLive) { var fileCachePath = Path.Combine(fileStore, "DocumentPreviewCache"); DefaultWebDocumentViewerContainer.UseFileDocumentStorage(fileCachePath); DefaultWebDocumentViewerContainer.UseFileExportedDocumentStorage(fileCachePath); DefaultWebDocumentViewerContainer.UseFileReportStorage(fileCachePath); var timeToLive = WebUtils.WebDocumentViewerTimeToLive; DefaultWebDocumentViewerContainer.RegisterSingleton<CacheCleanerSettings>(new CustomCacheCleanerSettings(timeToLive)); DefaultWebDocumentViewerContainer.RegisterSingleton<StoragesCleanerSettings>(new CustomStoragesCleanerSettings(timeToLive)); }
                                  Besides, I use the file to store the generated document, does the following code also need?  Or Is there the other need to store in memory cache? 
                                  [C#]
                                  DefaultWebDocumentViewerContainer.RegisterSingleton<CacheCleanerSettings>

                                  Thanks again.
                                • Vasily (DevExpress Support) 01.16.2019

                                  Hi Yuanjie,

                                  You are always welcome! The configuration that is specified in your "SetWebDocumentViewer" method is correct and won't conflict with the ICachedReportSourceWebResolver service registration.

                                  >>Besides, I use the file to store the generated document, does the following code also need?  Or Is there the other need to store in memory cache? 
                                  Using a file storage is a correct solution in case of load-balanced environment. That's because it is possible to connect all your web servers to a single shared folder that will be used to store documents previewed in your application. As for the CacheCleanerSettings option, it relates to an in-memory cache that stores documents that were loaded from the file storage. So, each time the document is loaded from a file storage this document is put into an in-memory cache for several minutes. This is used to speed up subsequent requests (to avoid reloading document from the file each time request is handled). By default this cache clearing timeout is set to 2 minutes.