We are using DevExpress DX.10.2. Our client has asked to be able to view the XtraReport templates (not the report itself, just the template) within an MVC 3 application that we maintain for them.

My first thought was that I'd have to fake the data to look like the "template" and show the actual reports. However, I noticed in Visual Studio that the XtraReport designer has an "HTML View" option that renders the template in HTML.

I would think that if DevExpress is able to render the template as HTML in the designer then it's likely that there's a way to extract that HTML to render on a view. Is there a way to extract HTML from an XtraReport template?

Thanks!

有帮助吗?

解决方案

Stumbled across the solution. Had to add a reference to DevExpress.XtraReports.Web and then the following line writes the report HTML to the response stream:

XtraReport1 report = new XtraReport1();
DevExpress.XtraReports.Web.ReportViewer.WriteHtmlTo(System.Web.HttpContext.Current.Response, report);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top