I would like to get grid total rows count before and after column filter.
Syncfusion ejs-grid in angular9
Please help me here.
Based on your query we suspect that you want to display the total records count in the Grid. To achieve your requirement we used the Aggregate feature of EJ2 Grid. The Aggregate values are displayed in the footer, group footer, and group caption of Grid, to show the aggregate value in any of these cells, use the footerTemplate, groupFooterTemplate and groupCaptionTemplate properties.
The aggregate value will be changed when we perform filtering in any of the columns. In the below sample we have bound the row count details in the footer of the Grid component using the Aggregate feature
Please refer to the below code example and sample for more information.
[app.component.html]
<ejs-grid [dataSource]="data" [allowPaging]="true" allowFiltering="true" [pageSettings]='pageOption'>
<e-columns>
<e-column field='CustomerName' headerText='Customer Name' width='150'></e-column>
<e-column field='Freight' headerText='Freight' width='150' format='C2' textAlign='Right'></e-column>
<e-column field='OrderDate' headerText='Order Date' width='150' format="yMd" textAlign='Right'></e-column>
<e-column field='ShipCountry' headerText='Ship Country' width='150'></e-column>
</e-columns>
<e-aggregates>
<e-aggregate>
<e-columns>
<e-column columnName="CustomerName" type="Count">
<ng-template #footerTemplate let-data>Rows Count: {{data.Count}}</ng-template>
</e-column>
</e-columns>
</e-aggregate>
</e-aggregates>
</ejs-grid>
sample
Help Documentation:
doc- built-in-aggregate-types
doc-footer-aggregate
Related
Can someone please help me write a custom code that will check if the details of the row group = nothing? I'd like to use this as a show/hide expression such that table 0 will not display if there are no records within the group.
I can't seem to use aggregations for the row group details at the row group level.
Edit:
example 1 with a detail row
example 2 with without a detail row but the group header still displays. I'd like to hide this group completely:
OK, so it looks like you want to hide a table, not just a group within a table.
If this is not correct , please post your full report design.
You should be able to just count the rows in the dataset that the table is bound to.
So if your table is bound to `DataSet`` the 'Hidden' property would just be
=COUNTROWS("DataSet1") = 0
"DataSet1" is the name of the dataset, it is case sensitive and must be enclosed in double quotes.
The table will be hidden but the space it consumes will not be used, in other words, you will have a blank space where the table should be.
Alternatively, you can set the NoRowsMessage property to simple text message or an expression which will be displayed instead of just hiding the table.
I ended up using an IIF(IsNothing(Fields!MyField.Value), Parameters!ShowMissingGroup.Value,False) for the row group expression visibility then using a parameter to hide/show it.
I have a requirement in which some selected group columns should be hidden, and rest group columns should display.
How can we achieve it using Kendo ui + Angular 6.
You can bind the ColumnComponent's hidden input to an expression that returns the respective boolean value after performing the required custom logic that will determine whether a column should be hidden or not.
The grouping configuration is available in the object the Grid group input is bound to.
Here is an example that demonstrates hiding all columns the data is grouped by, but ProductName:
EXAMPLE
What i want is the behaviour described here.
Basically i want to group small slices into a larger one. My problem is that the link does this based on what percentage the slices represent in the pie; I want to do this based in values of the series.
In the image below
I want to show all BizDevs as just one bizdev. can any one point me ot the right direction?
If you want to group certain categories together, you need to group on an expression that does this and not the base field.
Say I have simplified data like:
Which gives a chart as you'd expect:
In the category group we need to update the Group on value and the Label value:
Set the expression to:
=IIf(Fields!MyGroup.Value Like "BizDev*", "BizDev", Fields!MyGroup.Value)
i.e. if the group name starts with BizDev, put these in the same group.
These will now be grouped together:
I have a member that I want to display other member from data in group header. Look at below code:
#Html.Kendo().Grid<MailModel>()
...
.Columns(c=>
{
...
c.Bound(b=> b.ReceivedDate).ClientGroupHeaderTemplate("#:data.ReceivedDateStandard#");
...
})
.DataSource(ds=> ds
.Ajax()
.Group(g=>g.Add(i=>i.ReceivedDate))
);
Everything work great, but the group header text is "undefined"!!!
How can I show another member data in group header text?
Thanks for fallowing.....
Unfortunately, I don't think what you are trying to achieve is possible.
Logically, when you are grouping, the only members that you have available are the members that you are grouping by and the aggregates of that group.
Unless you can group by both ReceivedDate and ReceivedDateStandard or calculate ReceivedDateStandard from ReceivedDate then you wont be able to show ReceivedDateStandard in the group header.
for anyone with problem binding to the current value but with custom template, use this binding:
#:value#
instead of
#:data.FieldName#
I have a question, want some assistance.
Q) My question is that i have a chart in which analyst assigned for many incidents and some analyst have 1 or two incident assigned. just because of this the bar chart looks ugly some time. So thats why i used a new chart to represent Min incident count. But i want there some creativeness, for which i want there a radio button or OnClick event ( I do not know how to use both these. When report runs by default it`ll show Max incidents count chart and when we used radio button it will show Min incidents count chart, on the same chart area no need of new area or on new page.
Kindly help me or refer me some links and with ideas. As i have searched many blogs but i didn`t get any big achievement.
Below is my Simplified query;
SELECT
Count(IncidentDimvw.Id)
,UserDimvw.FirstName AS Analyst
FROM
IncidentDimvw
FULL JOIN WorkItemDimvw
ON IncidentDimvw.EntityDimKey = WorkItemDimvw.EntityDimKey
JOIN WorkItemAssignedToUserFactvw
ON WorkItemDimvw.WorkItemDimKey = WorkItemAssignedToUserFactvw.WorkItemDimKey
JOIN UserDimvw
ON WorkItemAssignedToUserFactvw.WorkItemAssignedToUser_UserDimKey = UserDimvw.UserDimKey
WHERE
WorkItemAssignedToUserFactvw.DeletedDate IS NULL
GROUP BY
UserDimvw.FirstName
Having (Count(IncidentDimvw.Id) = (#Count))
Having Clause is right or wrong, i donot know.
I used the following expresion in series as you suggested.
=iif(Parameters!Count.Value, Max(Sum(Fields!ID.Value)), Min(Sum(Fields!ID.Value)))
Sample data is as folows;
Regards
Muhammad Ahsan
I can think of a couple of ways to approach this:
Dynamic expressions based on parameter
Say you have a simple DataSet like:
And also a boolean parameter called showMax.
We can create a simple bar graph based on this:
The most important thing to note is that Series value is expression-based:
In the above example the expression is:
=IIf(Parameters!showMax.Value
, Max(Fields!value.Value)
, Min(Fields!value.Value))
i.e. when showMax is true, report the Max values, otherwise report the min values.
In this case I've also updated the Axis title, Chart title, and Custom legend text to be expression-based:
Axis Title: =IIf(Parameters!showMax.Value, "Max", "Min")
Chart Title: =IIf(Parameters!showMax.Value, "Max per group", "Min per group")
Custom legend text: =IIf(Parameters!showMax.Value, "Max value", "Min value")
The chart behaviour changes based on what parameter is selected as required:
Set Visibility based on parameter
Another option is simply to have to charts and hide one depending on parameter selection.
For example, for the Max chart the Hidden property can be set to:
=Not(Parameters!showMax.Value)
Setting this property correctly for each report will mean only one is ever displayed to the user, i.e. it will look dynamic.
Either of these options should work; the first keeps the layout simple in the designer makes the chart more complex, the second makes the layout more complex but keeps the charts simple.
Hopefully one option will work for you.