)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to enable paging in PivotGrid?

Platform: jQuery |
Control: ejPivotGrid |
Published Date: June 26, 2019 |
Last Revised Date: June 26, 2019

This KB illustrates that how to enable paging for PivotGrid.

Solution:

You can enable pager for PivotGrid with respective to JS, ASP and MVC platforms using the following code example.

Note:

Set EnablePaging to “True” and, SeriesPageSize as well as CategorialPageSize to a definite number, in the OLAP Report.

JavaScript

<script type="text/javascript">
$("#PivotGrid1").ejPivotGrid({ url: "../wcf/PagingService.svc });
$("#Pager").ejPivotPager({
            mode: ej.PivotPager.Mode.Both,
            targetControlID: "PivotGrid1"
});
</script>

MVC

@Html.EJ().Pivot().PivotGrid("PivotGrid1").Url(Url.Content("~/wcf/OLAPService.svc")
@Html.EJ().Pivot().PivotPager("PivotPager1").Mode(PivotPagerMode.Both).TargetControlID("PivotGrid1")

ASP

<ej:PivotGrid ID="PivotGrid1" Url="../wcf/OLAPService.svc" runat="server"></ej:PivotGrid>
<ej:PivotPager ID="PivotPager1" Mode="Both" TargetControlID="PivotGrid1"></ej:PivotPager>

C#

private OlapReport CreateOlapReport()
        {
            OlapReport olapReport = new OlapReport();
            olapReport.CurrentCubeName = "Adventure Works";
            olapReport.EnablePaging = true;
            olapReport.PagerOptions.SeriesPageSize = 20;
            olapReport.PagerOptions.CategorialPageSize = 15;
            DimensionElement dimensionElement = new DimensionElement() { Name = "Customer" };
            dimensionElement.AddLevel("Customer", "Customer");
            olapReport.CategoricalElements.Add(dimensionElement);
            DimensionElement dimensionElementRow = new DimensionElement() { Name = "Customer", HierarchyName = "Customer" };
            dimensionElementRow.AddLevel("Customer Geography", "Country");
            olapReport.SeriesElements.Add(dimensionElementRow);
            MeasureElements measureElementColumn = new MeasureElements();
            measureElementColumn.Elements.Add(new MeasureElement { Name = "Internet Sales Amount" });
            olapReport.CategoricalElements.Add(measureElementColumn);
            return olapReport;
        }

VB

Private Function CreateOlapReport() As OlapReport
 Dim olapReport As OlapReport = New OlapReport()
 olapReport.CurrentCubeName = "Adventure Works"
 olapReport.EnablePaging = True
 olapReport.PagerOptions.SeriesPageSize = 20
 olapReport.PagerOptions.CategorialPageSize = 15
 Dim dimensionElement As DimensionElement = New DimensionElement() With {.Name = "Customer"}
 dimensionElement.AddLevel("Customer", "Customer")
      olapReport.CategoricalElements.Add(dimensionElement)
 Dim dimensionElementRow As DimensionElement = New DimensionElement() With {.Name = "Customer", .HierarchyName = "Customer"}
 dimensionElementRow.AddLevel("Customer Geography", "Country")
 olapReport.SeriesElements.Add(dimensionElementRow)
 Dim measureElementColumn As MeasureElements = New MeasureElements()
 measureElementColumn.Elements.Add(New MeasureElement With {.Name = "Internet Sales Amount"})
 olapReport.CategoricalElements.Add(measureElementColumn)
 Return olapReport
End Function

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon