What I would like is to be able to export to a named sheet and keep the other sheets in file. For example:
"Sheet 1" (with new values), "Sheet2" (with old values)
Using your current naming convention, the Option might be named FileExportMode.CreateOrOverrideSheet
Add functionality which will allow the end users to edit the aggregated data. The new values should be passed back to the business logic of the application which will decide how to divide the new value across underlying records.
To reproduce the problem, use the following setup for RadPivotGrid:
public RadForm1()
{
InitializeComponent();
DataTable table = new DataTable();
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Salary", typeof(int));
table.Columns.Add("Title", typeof(string));
table.Rows.Add("John",1200,"Accountant");
table.Rows.Add("Ana", 800, "Accountant");
table.Rows.Add("Sam", 2500, "Manager");
table.Rows.Add("Tom", 1300, "Manager");
this.radPivotGrid1.RowGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "Title"});
this.radPivotGrid1.RowGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "Name" });
this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "Salary", AggregateFunction = AggregateFunctions.Sum });
this.radPivotGrid1.DataSource = table;
}
Follow the steps:
1. Filter the child group ("Name") >> Salary>1000.
This is the result of the applied filter:
2. Filter the parent group ("Title") >> Salary>1500.
After applying the filter, the observed result is that the Accountant group is still displayed even though it should be filtered and hidden (like in Excel):
Observed result:
Expected result:
When the RowGrandTotalsPosition and ColumnGrandTotalsPosition for RadPivotGrid are set to First, it would be suitable to offers options for keeping the row/column grand totals always visible in the view after scrolling:
When using Crystal or CrystalDark themes, the resize cursor is not showing to widen/shrink the columns:
Expected:
Actual:
In this case, we have Field1 and Field2 and some of the data source items will have equal values for both properties. In this case, the equal value is an empty string.
When we filter the rows by removing the empty string value, it will also remove the column which has the same value(empty string).
The result is not correct.
One should be able to move the selected cell and scroll with the arrow keys. The attached project features a solution for moving the currently selected cell using the arrow keys.
My pivot grid data size is 90,388 rows, and I export data to xlsx format with SheetName = "data".
The output file generated in this case (correctly) has 65536 rows on sheet "data" and the remaining 24852 rows on the sheet "data_2" (since SheetMaxRows = 65536 and total rows > SheetMaxRows, second sheet "data_2" is added automatically).
But the rows on the sheet "data_2" are written starting from line number 65538. The data on sheet "data_2" starts on line 65538 and goes till line 90389.
Expected:
Actual:
Workaround; use the following custom renderer:
public class MyRenderer : SpreadExportRenderer
{
public override void CreateCellSelection(int rowIndex, int columnIndex)
{
if (rowIndex > (int)Telerik.WinControls.UI.Export.ExcelMaxRows._65536)
{
rowIndex = rowIndex % (int)Telerik.WinControls.UI.Export.ExcelMaxRows._65536 - 1;
}
else
{
rowIndex = rowIndex % (int)Telerik.WinControls.UI.Export.ExcelMaxRows._65536;
}
base.CreateCellSelection(rowIndex, columnIndex);
}
}
Here is my code for localizing the Sum aggregate function. The obtained result is a partial translation:
public RadForm1()
{
PivotGridLocalizationProvider.CurrentProvider = new MyEnglishPivotGridLoclizationProvider();
InitializeComponent();
}
private void RadForm1_Load(object sender, EventArgs e)
{
this.ordersTableAdapter.Fill(this.nwindDataSet.Orders);
this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "OrderDate", Step = DateTimeStep.Year, GroupComparer = new GroupNameComparer() });
this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "OrderDate", Step = DateTimeStep.Quarter, GroupComparer = new GroupNameComparer() });
this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "OrderDate", Step = DateTimeStep.Month, GroupComparer = new GroupNameComparer() });
this.radPivotGrid1.ColumnGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "EmployeeID", GroupComparer = new GrandTotalComparer() });
this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction = AggregateFunctions.Sum });
this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction = AggregateFunctions.Count });
this.radPivotGrid1.FilterDescriptions.Add(new PropertyFilterDescription() { PropertyName = "ShipCountry", CustomName = "Country" });
this.radPivotGrid1.DataSource = this.ordersBindingSource;
}
class MyEnglishPivotGridLoclizationProvider : PivotGridLocalizationProvider
{
public override string GetLocalizedString(string id)
{
switch (id)
{
case PivotStringId.Sum:
return "Soma";
default:
return base.GetLocalizedString(id);
}
}
}
The "Sort" item doesn't seem to be relevant for the report filter. It should be removed from the menu items. However, for the "Hide" item it can be added logic for removing the filter:
GroupDescriptions loose the Custom Name after dragging.
The error is reproducible in the First look example of RadPivotGrid: