Hi All,
Here is the situation for me.
I have Profit and loss report
My Requirement is shown in Attachment .. Please go through Grouping.png and come here
for "Totals" Template i calling in code behind as
if (e.Column.UniqueName == "Account_No")
{
e.Column.Width = 120;
e.Column.HeaderTextAlignment = TextAlignment.Left;
var dataColumn = e.Column as GridViewDataColumn;
dataColumn.DataFormatString = "{0:N2}";
e.Column.TextAlignment = TextAlignment.Center;
if (i == 1)
{
e.Column.GroupFooterTemplate = (DataTemplate)VReportViewer.Resources["GroupFooterRowTemplate"];
}
}
the string "Totals" is Print after every Group using "ColumnGroupDescriptor " and i'm grouping using below code
if (this.ReportName == "Profit and Loss")
{
if (VReportViewer.GrdReport.Columns.Count == 9)
{
Telerik.Windows.Controls.GridView.ColumnGroupDescriptor descriptor = new ColumnGroupDescriptor();
descriptor.Column = VReportViewer.GrdReport.Columns["Account_Type"];
SumFunction sum = new SumFunction();
((GridViewDataColumn)VReportViewer.GrdReport.Columns["Amount"]).AggregateFunctions.Add(sum);
sum.ResultFormatString = "{0:c2}";
VReportViewer.GrdReport.GroupDescriptors.Add(descriptor);
}
}
and the Next Challenge I need to Group next level i'm showing example in attachment Please Help me to get these things
Gothrough Grouping2.png
Here is the situation for me.
I have Profit and loss report
My Requirement is shown in Attachment .. Please go through Grouping.png and come here
for "Totals" Template i calling in code behind as
if (e.Column.UniqueName == "Account_No")
{
e.Column.Width = 120;
e.Column.HeaderTextAlignment = TextAlignment.Left;
var dataColumn = e.Column as GridViewDataColumn;
dataColumn.DataFormatString = "{0:N2}";
e.Column.TextAlignment = TextAlignment.Center;
if (i == 1)
{
e.Column.GroupFooterTemplate = (DataTemplate)VReportViewer.Resources["GroupFooterRowTemplate"];
}
}
the string "Totals" is Print after every Group using "ColumnGroupDescriptor " and i'm grouping using below code
if (this.ReportName == "Profit and Loss")
{
if (VReportViewer.GrdReport.Columns.Count == 9)
{
Telerik.Windows.Controls.GridView.ColumnGroupDescriptor descriptor = new ColumnGroupDescriptor();
descriptor.Column = VReportViewer.GrdReport.Columns["Account_Type"];
SumFunction sum = new SumFunction();
((GridViewDataColumn)VReportViewer.GrdReport.Columns["Amount"]).AggregateFunctions.Add(sum);
sum.ResultFormatString = "{0:c2}";
VReportViewer.GrdReport.GroupDescriptors.Add(descriptor);
}
}
and the Next Challenge I need to Group next level i'm showing example in attachment Please Help me to get these things
Gothrough Grouping2.png