We are using the Kendo Pivot grid wrapped in Angular2 component. We are able to populate the pivot grid, but we are facing some issues in the following items
1. How do I change the background-color of the columnheader or grouping header in Pivot grid. I tried applying the following css in the custom.css but it is not getting affected with the grid.
.k-grouping-header k-grid-header th.k-header{
background-color: #F7F7F7 !important;
}
2. How do I get the Subtotals at the group level and Grand total at the overall level?
3. how to include the Grouped column name along with "All" in the group by RowHeaders (please refer the snapshot attached for more details)
Can anyone help me with these issues?
How do I change the background-color of the columnheader/rowHeader or grouping header in Kendo Pivot grid. I tried applying the following css in the custom.css but it is not getting affected with the grid. These classes are originally present in the kendo.common.min.css and I want to override it my custom CSS class.
how do I change or override it?
.k-grouping-header k-grid-header th.k-header{ background-color: #F7F7F7 !important;}
$(
"#pivotgrid"
).kendoPivotGrid({
configurator:
"#pivotconfigurator"
,
height: 550,
dataSource: {
type:
"xmla"
,
transport: {
connection: {
catalog:
"AdventureWorksDW2012Multidimensional-EE"
,
cube:
"Adventure Works"
},
read: {
url:
"http://test.cz/olap/msmdpump.dll"
,
}
},
error:
function
(e) {
alert(
"error: "
+ kendo.stringify(e));
},
schema: {
type:
"xmla"
}
}
});
With a remote data source, I can't get sortable working. In the UI the user can choose "Sort Ascending" or "Sort Descending", but the expanded values remain unsorted. Filter and all other features do work. Below the code. What am I doing wrong here? Thanks in advance.
$(document).ready(
function
() {
// prefilter posted from main page
var
postedCriteria = {{ json_encode($criteria) }};
// used for pivot/chart integration
var
collapsed = { columns: [], rows: [] };
var
dataSource =
new
kendo.data.PivotDataSource({
transport: {
read: {
url:
'{{ url("rapport/query") }}'
,
type:
"get"
,
dataType:
"json"
,
data: { criteria: postedCriteria }
}
},
schema: {
data:
"clients"
,
cube: {
dimensions: {
Client_geslacht: { caption:
"Geslacht"
},
Client_redenAfwijzing: { caption:
"Reden voor afwijzing"
},
Client_aanmelderSoort: { caption:
"Aanmeldersoort"
},
Client_landHerkomst: { caption:
"Land van herkomst"
},
Status_status: { caption:
"Status"
},
},
measures: {
"Aantal clienten"
: { field:
"Client_id"
, aggregate: CountDistinctAggregate },
"Aantal resultaten"
: { field:
"Resultaat_id"
, aggregate: CountDistinctAggregate },
"Totaalbedrag leefgeld"
: { field:
"Leefgeld_bedragLeefgeld"
, format:
"{0:c}"
, aggregate:
"sum"
},
}
}
},
columns: [{ name:
"Client_geslacht"
, expand:
true
}],
rows: [{ name:
"Status_status"
, expand:
true
}],
measures: [
"Aantal clienten"
]
});
var
pivotgrid = $(
"#pivotgrid"
).kendoPivotGrid({
filterable:
true
,
sortable:
true
,
columnWidth: 120,
height: 570,
dataSource: dataSource,
// chart integration:
dataBound:
function
() {
initChart(convertData(
this
.dataSource, collapsed));
},
// chart integration: gather the collapsed members
collapseMember:
function
(e) {
var
axis = collapsed[e.axis];
var
path = e.path[0];
if
(axis.indexOf(path) === -1) {
axis.push(path);
}
},
// chart integration: gather the expanded members
expandMember:
function
(e) {
var
axis = collapsed[e.axis];
var
index = axis.indexOf(e.path[0]);
if
(index !== -1) {
axis.splice(index, 1);
}
},
}).data(
"kendoPivotGrid"
);
$(
"#configurator"
).kendoPivotConfigurator({
dataSource: pivotgrid.dataSource,
filterable:
true
,
height: 570
});
$(
"#exportToExcel"
).click(
function
() {
pivotgrid.saveAsExcel();
});
});
function
CountDistinctAggregate(value, state, context)
{
if
(!state.distinctList) {
state.distinctList =
new
Array();
}
if
(value ==
null
|| $.inArray(value, state.distinctList) > -1) {
return
(state.accumulator || 0);
}
else
{
state.distinctList.push(value);
return
(state.accumulator || 0) + 1;
}
}
Hello,
We have list of flat POJO objects, where objects are dynamic, we don’t know their list of fields/properties at design time. In Silverlight version of telerik Pivot grid we were able to populate list of fields and provide list of objects so that users can create columns, rows and measures at run time.Is this approach feasible with Kendo UI Pivot? Or do we have to define model and cube with dimensions and measures in advance? An example would be very useful.
Thank you, Sergey
Does the count measure count the itens using DISTINCT?
For instance, let's say we have a dataSource like this:
var dados = [{ PersonID: 2958, Address: "5h St"},{ PersonID: 2958, Address: "​Lexington Ave"},{ PersonID: 2958, ​Address: "76th Street"}]
Note that it is only 1 person, which has 3 address.. if I wanted to use the COUNT measure on the Address, it is correct (it counts 3 itens). But when I use the COUNT measure on the PersonID, it also counts 3 itens, but there is only one personID. If the COUNT measure does not use DISTINCT, Is there any workaround for this?
Hi
I use PivotGrid v2016.1) with MS
SSAS (v2014) cube.
In my cube I created several calculated members, (one named EAC)
on dimension named Category.
When I’m using this dimension in PivotGrid as a column PivotGrid doesn’t
show any calculated members, but only dimension child members.
PivotGrid generates this MDX query:
SELECT
NON EMPTY {[Category].[Category].[
All
],[Category].[Category].[
All
].Children} DIMENSION PROPERTIESCHILDREN_CARDINALITY, PARENT_UNIQUE_NAME
ON
COLUMNS
FROM
[SDCOE]
WHERE
([Measures].[Value Cost])<br>
PivotGrid generates this MDX query:
<p>
SELECT
NON EMPTY {[Category].[Category].[
All
],[Category].[Category].[
All
].Children} DIMENSION PROPERTIESCHILDREN_CARDINALITY, PARENT_UNIQUE_NAME
ON
COLUMNS
FROM
(
SELECT
({[Category].[Category].&[1],[Category].[Category].[
All
].[EAC]})
ON
0
FROM
[SDCOE])
WHERE
([Measures].[Value Cost])</p><p></p>
Does it mean PivotGrid does't support dimension calculated members?