製品版のみの機能
ピボット グリッド - ADOMD.NET
このサンプルは、igPivotGrid コントロールで ADOMD.NET リモート データ プロバイダーを使用する方法を紹介します。
このサンプルは CTP 機能を使用しています。製品版では、API や動作が変更される場合があります。
このサンプルは、より大きい画面サイズのためにデザインされました。
モバイル デバイスで画面を回転、フル サイズ表示、またはその他のデバイスにメールで送信します。
すべての要求は、クロス ドメインの問題を防止するためにサーバー アプリケーションを介してプロキシーされます。また、応答サイズを小さくするために、データが JSON に変換されます。注: このサンプルは、 OLAP データをアクセスするために、インターネット接続が必要です。
コード ビュー
クリップボードへコピー
@using Infragistics.Web.Mvc
@using IgniteUI.SamplesBrowser.Models
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Ignite UI for jQuery Required Combined CSS Files -->
<link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
<link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/structure/infragistics.css" rel="stylesheet" />
<script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<!-- Ignite UI for jQuery Required Combined JavaScript Files -->
<script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.core.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.lob.js"></script>
<style>
#dataSelector, #pivotGrid {
float: left;
}
</style>
</head>
<body>
<div class="sampleContent">
<div id="dataSelector"></div>
<div id="pivotGrid"></div>
</div>
<script type="text/javascript">
$.support.cors = true;
$(function () {
var adomdDataSource = new $.ig.OlapXmlaDataSource({
isRemote: true,
serverUrl: '@Url.Action("adomd-provider-endpoint")',
catalog: 'Adventure Works DW Standard Edition',
cube: 'Adventure Works',
rows: '[Date].[Calendar]',
columns: '[Product].[Product Categories]',
measures: '[Measures].[Internet Order Count]'
});
adomdDataSource.initialize()
.done(function(rootMetadataItem) {
$('#dataSelector').igPivotDataSelector({
dataSource: adomdDataSource,
height: "600px",
width: "240px"
});
$("#pivotGrid").igPivotGrid({
dataSource: adomdDataSource,
height: "600px",
width: "570px"
});
})
.fail(function (error) {
$("#pivotGrid").html("<h4>サーバーでエラーが発生しました。 <br> Microsoft.AnalysisServices.AdomdClient アセンブリがインストールされていない可能性があります。 <br> Microsoft® SQL Server® 2008 R2 ADOMD.NET を<a target='_blank' href='http://www.microsoft.com/ja-jp/download/confirmation.aspx?id=16978'>ここ</a>からダウンロードできます。 <br>また、このアセンブリのその他のバージョンがインストールされている場合、web.config ファイルでバインディング リダイレクトを構成できます。 詳細については、この<a target='_blank' href='http://help.jp.infragistics.com/doc/jquery/?page=igOlapXmlaDataSource_Configuring_Through_a_Remote_Provider.html'>ヘルプ トピック</a>を参照してください。</h4>");
});
});
</script>
</body>
</html>
using System.Web.Mvc;
using Infragistics.Web.Mvc;
using IgniteUI.SamplesBrowser.Application.Data;
using System.Data;
using System.Data.SqlClient;
using IgniteUI.SamplesBrowser.Models.Repositories;
using Newtonsoft.Json.Converters;
using System.Linq;
using System;
namespace IgniteUI.SamplesBrowser.Controllers
{
public class PivotGridController : Controller
{
[AdomdDataSourceAction]
[ActionName("adomd-provider-endpoint")]
public ActionResult RemoteAdomdProviderEndpoint()
{
return View(new AdomdDataSourceModel()
{
ConnectionString = "Provider=MSOLAP.4;Persist Security Info=True;Data Source=http://sampledata.infragistics.com/olap/msmdpump.dll;Initial Catalog=Adventure Works DW Standard Edition;MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error"
});
}
[ActionName("remote-adomd-provider")]
public ActionResult AdomdProvider()
{
return View("remote-adomd-provider");
}
[XmlaDataSourceAction]
[ActionName("remote-xmla-provider-endpoint")]
public ActionResult RemoteXmlaProviderEndpoint()
{
return View(new XmlaDataSourceModel { ServerUrl = "http://sampledata.infragistics.com/olap/msmdpump.dll" });
}
[ActionName("remote-xmla-provider")]
public ActionResult RemoteXmlaProvider()
{
return View("remote-xmla-provider");
}
[ActionName("using-the-asp-net-mvc-helper-with-flat-data-source")]
public ActionResult UsingAspNetMvcHelperWithFlatDataSource()
{
var invoices = RepositoryFactory.GetInvoiceRepository().Get().Take(200).Select(invoice => new
{
Address = invoice.Address,
City = invoice.City,
CustomerName = invoice.CustomerName,
Discount = invoice.Discount,
Freight = invoice.Freight,
OrderDate = invoice.OrderDate == null ? null : invoice.OrderDate.Value.AddYears(16).ToShortDateString(),
ProductName = invoice.ProductName,
Quantity = invoice.Quantity,
RequiredDate = invoice.RequiredDate == null ? null : invoice.RequiredDate.Value.AddYears(16).ToShortDateString(),
Salesperson = invoice.Salesperson,
ShipCountry = invoice.ShipCountry,
ShippedDate = invoice.ShippedDate == null ? null : invoice.ShippedDate.Value.AddYears(16).ToShortDateString(),
ShipperName = invoice.ShipperName
});
return View("using-the-asp-net-mvc-helper-with-flat-data-source", invoices);
}
[ActionName("using-the-asp-net-mvc-helper-with-xmla-data-source")]
public ActionResult UsingAspNetMvcHelperWithXmlaDataSource()
{
return View("using-the-asp-net-mvc-helper-with-xmla-data-source");
}
}
}