Hi,
I am having issue where the pivotgrid's column/row 's headers are showing "[FieldName]&undefined".
I saw one example (http://dojo.telerik.com/@ggkrustev/imokI) provided by Georgi in one of the post (https://www.telerik.com/forums/pivot-grid-showing-nothing), the column's header is also showing "AssetClass&undefined".
Could anyone advise why is it so ?
thanks.
Regards,
Hage
I have tried setting up a pivot grid following the demos at http://demos.telerik.com/aspnet-mvc/pivotgrid/local-flat-data-binding and http://demos.telerik.com/aspnet-mvc/pivotgrid/remote-flat-data-binding.
using this model
public
class
FundModel
{
public
string
AssetClass {
get
;
set
; }
public
DateTime ReportDate {
get
;
set
; }
public
decimal
? AssetsStart {
get
;
set
; }
}
and this controller
public
ActionResult TestView()
{
return
View(
// GetAdvisors()
GetFunds()
);
}
private
IEnumerable<FundModel> GetFunds()
{
IEnumerable<FundModel> funds;
using
(var context =
new
EPFRUI_Entities())
{
funds = context.vwDailyFundFlowDetails.Take(300).Select(x =>
new
FundModel
{
AssetClass = x.FundName,
ReportDate = x.ReportDate,
AssetsStart = x.AssetsStart
}).ToList();
}
return
funds;
}
I am passing in my data to this pivot grid based on the demo code
@(Html.Kendo().PivotConfigurator()
.Name(
"configurator"
)
.Height(570)
)
@(Html.Kendo().PivotGrid<FundModel>()
.Name(
"pivotgrid"
)
.Configurator(
"#configurator"
)
.ColumnWidth(120)
.Height(570)
.BindTo(Model)
.DataSource(dataSource => dataSource
.Ajax()
.Schema(schema => schema
.Model(m => m.Field(
"CategoryName"
,
typeof
(
string
)).From(
"Category.CategoryName"
))
.Cube(cube => cube
.Dimensions(dimensions => {
dimensions.Add(model => model.AssetsStart).Caption(
"Assets Start"
);
dimensions.Add(
"CategoryName"
).Caption(
"All Categories"
);
dimensions.Add(model => model.AssetClass).Caption(
"AssetClass"
);
})
.Measures(measures => measures.Add(
"AssetsStart"
).Field(model => model.AssetsStart).AggregateName(
"count"
))
))
.Columns(columns =>
{
columns.Add(
"CategoryName"
).Expand(
true
);
columns.Add(
"AssetClass"
);
})
.Rows(rows => rows.Add(
"AssetClass"
).Expand(
true
))
.Measures(measures => measures.Values(
"Sum"
))
.Events(e => e.Error(
"onError"
))
)
)
Which is getting me a single long line when I run the program and navigate to the view. I have included what shows up in the attached image.
I have also tried setting this up with remote binding and got the same view.
Am I missing an obvious step here? I debugged it and the model has data when the pivot grid is called, and no errors are coming back from the pivotgrid
I am getting error after i integrated Cube to Pivotgrid in cshtml. however, cube is producing result in excel when i tried. please see attached image for error and excel result generated from cube.
this is the major piece my manager is looking before he approves Telerik license budget and i have only 3 days left to trial version.
please help ASAP.
here is the code.
@(Html.Kendo().PivotConfigurator()
.Name("configurator")
.HtmlAttributes(new { @class = "hidden-on-narrow" })
.Filterable(true)
.Sortable()
.Height(580)
)
@(Html.Kendo().PivotGrid()
.Name("pivotgrid")
.ColumnWidth(200)
.Height(580)
.HtmlAttributes(new { @class = "hidden-on-narrow" })
.Filterable(true)
.Sortable()
.Configurator("#configurator")
.DataSource(dataSource => dataSource.
Xmla()
.Columns(columns =>
{
columns.Add("[Incident].[Status]").Expand(true);
})
.Rows(rows => rows.Add("[Clients].[Id]"))
.Measures(measures => measures.Values(new string[] { "[Measures].[Incident Count]" }))
.Transport(transport => transport
.Connection(connection => connection
.Catalog("NextGenToolIncidentCube")
.Cube("[IncidentAnalyticalCube"))
.Read(read => read
.DataType("text")
.ContentType("text/xml")
.Type(HttpVerbs.Post)
)
)
.Events(e => e.Error("onError"))
)
)
Hi people.
I'm implementing PivotGrid on my ASP.NET MVC application. With the Grid component, I was able to make filters based on a selection of which values I want due to bounded columns capture feature.
Is there something like this on PivotGrid?
In Grid component. I've done the filter just like this:
var bounded = gridColumns.Bound(dataTableCol.GetType(), dataTableCol.ToString());
// If the column has a multicheckbox filter - set it based on column definition
var customFilterColumn = Model.columns.SingleOrDefault(item => item.ColumnName.Equals(dataTableCol.ToString()));
if (customFilterColumn != null)
{
bounded.Filterable(ftb => ftb
.Multi(true)
.Cell(cell =>
cell.DataSource(ds =>
// This is the action that will return the filter unique values
ds.Read("MultiFilter_read", "Consulta", new { columnId = customFilterColumn.Id }))));
bounded.Width(300);
}
In "Consulta/MultiFilter_read" action I make a search on database returning the possible values for that column, applying them to the respective bounded column. This instructions I've put on Columns property of the Grid HtmlHelper, and I'm doing PivotGrid with HtmlHelpers too.
Hi,
is there a way (like in PivotGrid for ASP.NET AJAX) to persist a pivot grid on the server.
Usage: the user drags columns around till he has the desired result - with save he can persist this "view" on the server. Later he can recall this "view" to have the same PivotGrid configuration again.
Manfred
I have follow Kendo UI for ASP.NET MVC Local binding example to create my pivot view.
At my pivot grid, the rows is group by a date, however, the date display on the row header is a long date format. How to format a date in a row header column to a short date?
At the following code, I am able to use the template to format a date field to a short the format, but not on the row header column. please see the picture for the detail.
@model IEnumerable<
TelerikMVCStudy.Domain.Dailyforecast_view
>
@{
ViewBag.Title = "Index";
}
<
h2
>Pivot</
h2
>
@(Html.Kendo().PivotConfigurator()
.Name("configurator")
.HtmlAttributes( new { @class = "hidden-on-narrow"})
.Height(570)
)
@(Html.Kendo().PivotGrid<
TelerikMVCStudy.Domain.Dailyforecast_view
>()
.Name("pivotgrid")
.HtmlAttributes(new { @class = "hidden-on-narrow" })
.Configurator("#configurator")
.Height(579)
.BindTo(Model)
.DataCellTemplateId("dataCellTemplate")
.ColumnHeaderTemplateId("headerTemplate")
.RowHeaderTemplateId("rowHeaderTemplate")
.DataSource(dataSource => dataSource
.Ajax()
.Schema(schema => schema
.Model(m => m.Field("Utility", typeof(string)).From("Utility"))
.Cube(cube => cube
.Dimensions(dimensions =>
{
dimensions.Add(model => model.Portfolio).Caption("Portfolio");
dimensions.Add(model => model.Utility).Caption("All Utility");
dimensions.Add(model => model.CalendarDate.ToShortDateString()).Caption("CalendarDate");
})
.Measures(measures =>
{
measures.Add("sum").Format("{0:N4}").Field(model => model.MMBtu).AggregateName("sum");
measures.Add("max").Field(model => model.CalendarDate).AggregateName("max");
})
)
)
.Columns(columns =>
{
columns.Add("Utility").Expand(true);
})
.Rows(rows => rows.Add("CalendarDate").Expand(true))
.Measures(measures => measures.Values("sum"))
.Events(e => e.Error("onError"))
)
)
<
script
>
function onError(e) {
alert("error: " + kendo.stringify(e.errors[0]));
}
</
script
>
<
script
id
=
"dataCellTemplate"
type
=
"text/x-kendo-tmpl"
>
# var columnMember = columnTuple ? columnTuple.members[0] : { children: [] }; #
# var rowMember = rowTuple ? rowTuple.members[0] : { children: [] }; #
# var value = (dataItem.value instanceof Date) ? kendo.toString(dataItem.value,"d") : kendo.toString(kendo.parseFloat(dataItem.value) ||"N/A", "N4"); #
# if (columnMember.children.length || rowMember.children.length) { #
<
em
style
=
"color: red"
>#: value # (total)</
em
>
# } else { #
#: value #
# } #
</
script
>
<
script
id
=
"headerTemplate"
type
=
"text/x-kendo-tmpl"
>
# if (!member.children.length) { #
<
em
>#: member.caption #</
em
>
# } else { #
#: member.caption #
# } #
</
script
>
<
script
id
=
"rowHeaderTemplate"
type
=
"text/x-kendo-tmpl"
>
# if (!member.children.length) { #
<
em
>#: member.caption #</
em
>
# } else { #
#: member.caption #
# } #
</
script
>
<
style
>
#pivotgrid
{
display: inline-block;
vertical-align: top;
width: 70%;
}
#configurator
{
display: inline-block;
vertical-align: top;
}
.hidden-on-narrow {
display: inline-block;
vertical-align: top;
}
</
style
>
Hi All,
I'm currently in a trial period for the MVC UI suite, and i'm currently configuring the pivot grid to fit our current project.
Now just currently going through the features of this pivot grid i realise that the AJAX pivot grid has far more functionality than the MVC one.
One function in particular i would like for the MVC pivot grid is the AJAX pivot grid field list functionality, as seen here.
Now is this possible? And if so is there any examples of this.
Thanks,
Jamie
I've got data that looks like this from a DB:
FromSomething ToSomething Amount
place a place b 1.55
place d place b 2.33
place a place f 1.20
and so on .....
I need it to go in a matrix that looks like this:
place b place f place m
place a 1.33 1.25 .50
place b 0 1.00 .25
I can't get this to work at all, using the pivot grid and configuring it like the Telerik demos site, using local binding. The grid is blank.
Is the pivot grid right for this? If so, how should it work?