When i try to restore report from .prnx, reprot looks like empty.
Solution with example in attachment.
HTML5 Document Viewer - Empty document appears when restoring a document from prnx
Answers approved by DevExpress Support
We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.
Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.
To load the generated document and preview it in the ASPxWebDocumentViewer, you can use an approach similar to the one given below:
C#protected void Page_Load(object sender, EventArgs e) {
ASPxWebDocumentViewer1.OpenReport(GetReport());
}
XtraReport GetReport() {
XtraReport report = new XtraReport1();
report.AfterPrint += report_AfterPrint;
return report;
}
void report_AfterPrint(object sender, EventArgs e) {
string prnxFilePath = AppDomain.CurrentDomain.BaseDirectory + "your prnx file path";
((XtraReport)sender).PrintingSystem.LoadDocument(prnxFilePath);
}
- v15.2.4Download Official Update
- v15.1.9Download Official Update
Is it a work around or a final fix?
Can I restore report without "report.AfterPrint += report_AfterPrint" if i load 15.2.4 ?
Hello Pavel,
A realize that the situation may look a bit confusing. Let me clarify. The code snippet marked as a solution will work starting with the mentioned version (15.1.9, 15.2.4).
Due to the current architecture of the ASPxWebDocumentViewer, this solution is the recommended way for the time being.
I want to inform you that we've already discussing another related problem and our developers will keep working on it in the scope of the HTML5 Document Viewer - Provide the capability to avoid the recreation of a document before previewing a report ticket. You can add it to your favorites to receive notifications on our progress.
Thanks
Hello Pavel,
I see that the test.prnx file produces an empty document. In the test.prnx file, there is information that the document contains zero pages. Please make sure that the original document is successfully created and hence, provides the required content (the page number is greater than zero). Then, save the report document as shown in How to: Save and Restore a Report Document from a File.
Please keep me posted.
Attached is not an empty prnx But the viewer still displays no pages.
If you remove test.prnx, it will generate a new one, and it has no pages. But if we add report.CreateDocument (); the page is. But they do not appear in the viewer.
Thank you for the update, Pavel. I was able to reproduce the issue and passed it to our developers for investigation. Basically, this issue is related to the HTML5 Document Viewer's engine and we need more time to research this behavior. Your patience is appreciated.
At the moment, you can switch back to the ASP.NET Document Viewer.
Well, we look forward to fix! Now we use the old viewer, but it does not satisfy us.