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
When using Crystal or CrystalDark themes, the resize cursor is not showing to widen/shrink the columns:
Expected:
Actual:
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);
}
}
}
GroupDescriptions loose the Custom Name after dragging.
The error is reproducible in the First look example of RadPivotGrid:
The group description now has AutoShowSubTotals property determining whether subtotals will be generated for the description: this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription { PropertyName = "OrderDate", Step = DateTimeStep.Quarter, GroupComparer = new GroupNameComparer(), AutoShowSubTotals = false });
Check the attached screenshot:
Hour, minute, second, if possible also week
How to reproduce: see the attached video Workaround: public partial class Form2 : Form { public Form2() { InitializeComponent(); this.radPivotFieldList1.DragDropService = new CustomPivotFieldListDragDropService(this.radPivotFieldList1); } private void Form2_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'nwindDataSet.Orders' table. You can move, or remove it, as needed. this.ordersTableAdapter.Fill(this.nwindDataSet.Orders); } } public class CustomPivotFieldListDragDropService : PivotFieldListDragDropService { private RadPivotFieldList fieldList; private Telerik.WinControls.UI.PivotFieldList.FieldPayload payload; public CustomPivotFieldListDragDropService(RadPivotFieldList fieldList) : base(fieldList) { this.fieldList = fieldList; } protected override void PerformStart() { base.PerformStart(); Telerik.WinControls.UI.PivotFieldList.IField draggedField = this.GetField(this.Context); if (draggedField == null) { this.Stop(false); return; } this.payload = new Telerik.WinControls.UI.PivotFieldList.FieldPayload(draggedField); } protected override void OnPreviewDragOver(RadDragOverEventArgs e) { RadElement targetElement = this.DropTarget as RadElement; Telerik.WinControls.UI.PivotFieldList.IField targetField = this.GetField(targetElement); if (targetElement != null && targetElement.ElementTree.Control == this.fieldList.ReportFiltersControl && this.payload != null) { foreach (Telerik.WinControls.UI.PivotFieldList.IField field in this.fieldList.ViewModel.Filters) { if (field.FieldInfo == payload.DraggedField.FieldInfo && this.Context is TreeNodeElement )) { e.CanDrop = false; this.payload.SetDestination(null); this.payload.RemoveFromSource = false; return; } } } base.OnPreviewDragOver(e); } private Telerik.WinControls.UI.PivotFieldList.IField GetField(object context) { RadListVisualItem listItem = context as RadListVisualItem; TreeNodeElement treeItem = context as TreeNodeElement; PivotFieldListItemButton button = context as PivotFieldListItemButton; if (button != null) { listItem = button.Owner; } Telerik.WinControls.UI.PivotFieldList.IField field1 = null, field2 = null; if (listItem != null && listItem.Data != null) { field1 = listItem.Data.DataBoundItem as Telerik.WinControls.UI.PivotFieldList.IField; } if (treeItem != null && treeItem.Data != null) { field2 = treeItem.Data.DataBoundItem as Telerik.WinControls.UI.PivotFieldList.IField; } return field1 ?? field2; } }
The issue may manifest if aggregate descriptions are added on the pivot`s column axis and if their member does not return data.
I came across an exception when trying to use the Report Filter area with data that contains blank (DBNull) values. It looks like the control tries to build a distinct list of values to show in the filter's drop-down, but throws an exception if one of the values is blank. I attached a ZIP file with a Visual Studio project that demonstrates the issue, and included a Word file to describe how to reproduce the error. Any assistance is greatly appreciated. Thank you. Drew White Developer CRMCulture, LLC Email: dwhite@CRMCulture.com Web: http://www.crmculture.com
How to reproduce: Me.RadPivotGrid1.DataSource = Nothing Workaround: DirectCast(Me.RadPivotGrid1.DataProvider, LocalDataSourceProvider).ItemsSource = Nothing Dim viewModel = Me.RadPivotGrid1.PivotGridElement.GetType().GetField("viewModel", BindingFlags.Instance Or BindingFlags.NonPublic).GetValue(Me.RadPivotGrid1.PivotGridElement) viewModel.GetType().GetProperty("DataProvider").SetValue(viewModel, Nothing)