This is a migrated thread and some comments may be shown as answers.

Pivot Grid showing nothing

3 Answers 194 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 20 Oct 2015, 03:21 PM

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

 

 

 

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Oct 2015, 01:33 PM
Hello Alex,

I reviewed the code snippets and noticed that you are adding same dimensions for both axes, which is not supported. If the dimensions are setup correctly, the widget works as expected:
Regards,
Georgi Krustev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Hage
Top achievements
Rank 1
answered on 11 Mar 2018, 04:13 PM

Hi Goergi,

I am looking at the sample you provided: http://dojo.telerik.com/@ggkrustev/imokI

I saw that the Asset Class at the pivotgrid's column is showing: AssetClass&undefined.

Do you know why is it so ? currently I am testing the pivotgrid and encountering the same issue, column or row are showing "[FieldName]&undefined"

 

Thanks.

0
Stefan
Telerik team
answered on 13 Mar 2018, 08:29 AM
Hello, Hage,

Thank you for noticing this.

After inspecting the example I noticed that the field name in the data is "AssetsClass" but it was used as "AssetClass" in the PivotGrid. This leads to a case where the PivotGrid is not making a match.

After I set the widget to use the "AssetsClass" the example was working as expected:

http://dojo.telerik.com/oFiManep

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
PivotGrid
Asked by
Alex
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Hage
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or