在我的web應用程序中,我使用的是asp.net mvc5和angular1.5.All視圖使用ui-view呈現爲部分。 我需要將DevExpress報告與mvc5和角度js集成。 有沒有人有想法如何我可以將DevExpress報告與mvc5和angularjs 1.5集成。DevExpress報告與mvc和角js
1
A
回答
0
請查看您的問題下面的鏈接,目前的解決方案是有單獨的頁面,報表查看器,你可以使用iframe來展示其應用內的
https://www.devexpress.com/Support/Center/Question/Details/T289424 https://www.devexpress.com/Support/Center/Question/Details/T422061
快樂編碼: )
1
此方法將幫助您動態選擇報告和數據。我試過了。
Angularview。
<div ng-app="DemoApp" ng-controller="DemoController">
<table style="width:100%;height:100%;">
<tr>
<td style="background-color:gray;width:20%;vertical-align: top;text-align: left;">
<h3>Select report tamplates</h3>
<ul>
<li ng-repeat="r in reports"><h6 ng-click="reportSelected(r.type)">{{r.type}}</h6></li>
</ul>
</td>
<td style="background-color:forestgreen;">
<iframe src="/Home/Index" style="width:100%;height:800px" id="viewer"></iframe>
</td>
</tr>
</table>
</div>
家庭控制器。
public class HomeController : Controller
{
public ActionResult Index()
{
//i am getting some parameter from angular by query string and acordingli decide with report template and data need to add.
var type = Request.QueryString["Type"];//parameter from angular
if (type != null)
{
type.Trim();
}
else { type = "Xm"; }
if (type.Equals("Pipe"))
{
ViewBag.Path = @"report path";
ViewBag.Data = "data json in my case";
}
else
{
ViewBag.Path = @"aspx report path";//you can specify this report at runtime
ViewBag.Data = //json data in my case,you can add any data wicht impliments ILIST or related interfaces;
}
return View();
}
}
索引視圖(生成報告)。
@{
ViewBag.Title = "Home Page";
}
@Html.DevExpress().WebDocumentViewer(settings =>
{
settings.Name = "WebDocumentViewer";
}).Bind((new DXWebApplication1.Reports.Class1(@ViewBag.Path, @ViewBag.Data)).getReport()).GetHtml()
//(DXWebApplication1.Reports.Class) this class is created to return report
返回報表查看的類。
DXWebApplication1.Reports.Class 。
public class Class1
{
public DevExpress.XtraReports.UI.XtraReport report { get; set; }
public Class1(string filepath, string datasource)
{
this.report = new DevExpress.XtraReports.UI.XtraReport();
this.report.LoadLayout(filepath);
this.report.DataSource = JsonConvert.DeserializeObject<List<JobCode>>(datasource);
}
public DevExpress.XtraReports.UI.XtraReport getReport()
{
return this.report;
}
作爲使用休息服務,我正在序列化JSON到C#類的報告。
C#類用於反序列化json數據。
class JobCode
{
[JsonProperty("Description")]
public string Description { get; set; }
[JsonProperty("Size")]
public int Size { get; set; }
[JsonProperty("Weight")]
public int Weight { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
}
相關問題
- 1. devexpress xtrareports與報告服務
- 2. 角js報告鉻和mozilla錯誤
- 3. Devexpress報告和DBContext數據源
- 4. C#Devexpress,更新報告
- 5. DevExpress的報告獲取有
- 6. 如何創建DevExpress報告
- 7. 與Spring MVC的角度JS
- 8. 彈簧mvc與角js
- 9. 如何使用實體框架與DevExpress報告工具創建報告
- 10. 角js和彈簧mvc
- 11. 使用在單DevExpress的報告多數據表的報告
- 12. DevExpress報告工具欄沒有選擇報告查看器
- 13. ActiveReports 8 - 部分報告與主要報告和子報告
- 14. 我不能使用第三方js與角js和ASP.NET MVC
- 15. devexpress mvc PageControl和PerformCallback
- 16. Devexpress報告減號在右邊
- 17. 圖形/水晶報告與ASP.Net MVC
- 18. 使用報告服務與asp.net mvc 2.0
- 19. .NET MVC 5 C#與晶體報告
- 20. ASP .NET MVC報告
- 21. 與剪切和grep報告
- 22. 總和與角JS v1.5.5
- 23. DevExpress XtraReports - 主和子報告都存儲proc
- 24. DevExpress MVC GridView和回調
- 25. 提供儀表板和報告功能與MVC 4
- 26. 與Jfreechart報告?
- 27. 量角器測試報告
- 28. 報告與子報告ms訪問2007
- 29. vs2012水晶報告與快速報告
- 30. VS2008報告與水晶報告