[英]XtraReport not showing any data
I have followed the instructions from this documentation link . 我已按照本文档链接中的说明进行操作。 The xtrareport shows the box toolbar but it doesnot shows any data.
xtrareport显示框工具栏,但不显示任何数据。 What am I doing wrong?
我究竟做错了什么?
In my HomeController.cs 在我的HomeController.cs中
public ActionResult Index()
{
ViewBag.Message = "Welcome to DevExpress Extensions for ASP.NET MVC!";
ViewData["Report"] = new DXApplication.Reports.XtraReport1();
return View();
}
public ActionResult DocumentViewerPartial()
{
ViewData["Report"] = new DXApplication.Reports.XtraReport1();
return PartialView("DocumentViewerPartial");
}
public ActionResult ExportDocumentViewer()
{
return DevExpress.Web.Mvc.DocumentViewerExtension.ExportTo(new DXApplication.Reports.XtraReport1());
}
DocumentViewerPartial.cs DocumentViewerPartial.cs
**@Html.DevExpress().DocumentViewer(settings =>
{
settings.Name = "DocumentViewer";
settings.Report = (DXApplication.Reports.XtraReport1)ViewData["Reports"];
settings.CallbackRouteValues = new { Controller = "Home", Action = "DocumentViewerPartial" };
settings.ExportRouteValues = new { Controller = "Home", Action = "ExportDocumentViewer" };
}).GetHtml()**
And Index.cshtml 和Index.cshtml
{
ViewBag.Title = "Home Page";
}
@ViewBag.Message
@Html.Action("DocumentViewerPartial")
尝试通过使用ViewData["Report"]
更改DocumentViewerPartial.cs ViewData["Reports"]
ViewData["Report"]
In XtraReport1 how do you write? 在XtraReport1中,您如何编写? it would be great if you provide your code XtraReport1 or provide us with a simple demonstrating with case.
如果您提供代码XtraReport1或为我们提供一个简单的案例演示,那将是很好的。 I saw in your Controller, if you write that, it will get data 3rd: ViewData["Report"] = new DXApplication.Reports.XtraReport1();
我在您的Controller中看到,如果您编写该代码,它将获得第3个数据:ViewData [“ Report”] = new DXApplication.Reports.XtraReport1();
Ready you only need get data 1st, you can write: 准备就绪,您只需要获取数据1,就可以编写:
public ActionResult Index()
{
ViewBag.Message = "Welcome to DevExpress Extensions for ASP.NET MVC!";
return View();
}
public ActionResult DocumentViewerPartial()
{
Session["Report"] = new DXApplication.Reports.XtraReport1();
return PartialView("DocumentViewerPartial");
}
public ActionResult ExportDocumentViewer()
{
return DevExpress.Web.Mvc.DocumentViewerExtension.ExportTo(Session["Report"] as XtraReport1());
}
And in DocumentViewerPartial.cs you edit: 然后在DocumentViewerPartial.cs中进行编辑:
@Html.DevExpress().DocumentViewer(settings =>{
settings.Name = "DocumentViewer";
settings.Report = (DXApplication.Reports.XtraReport1)Session["Reports"];
settings.CallbackRouteValues = new { Controller = "Home", Action = "DocumentViewerPartial" };
settings.ExportRouteValues = new { Controller = "Home", Action = "ExportDocumentViewer" };}).GetHtml()
Then final in file Index.cshtml you call: 然后最终在文件Index.cshtml中调用:
@Html.Partial("ExportDocumentViewer")
@Html.Partial("DocumentViewerPartial")
Please perform the corresponding modifications and let me know your results. 请执行相应的修改,并让我知道您的结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.