For example: If you grouping using of DateTimeGroupDescription you should be able to format date as dd.MM.yyyy instead of Apr-22 Resolution: You can use the GroupElementFormatting event to format the text in the GroupDescription elements. Please, note that the developer should add an own logic for formatting a date (for example you should take the year and month from another fields)
RadPivot prints only left columns and the columns placed on the right part of the control do not print
GroupDescriptions loose the Custom Name after dragging.
Drag the field contains date from field choicer control to Column data area. Then remove one of the sum field. The exception will thrown. Workaround: Use the DLLs for NET2.0
Change the Decimal symbol/separator to "," and run Excel export for the RadPivotGrid. Note that all "0,00" cells are displayed as "1" in Excel and all decimal values are displayed without decimal separator. Another scenario is when you change the Format in the Regional settings to Russia. Then, when exporting data, the decimal separator for the GrandTotal column is not correct ".", instead of ",". However, for the data cells it is OK.
Workaround: remove the localization provider before saving the layout and then add it back.
Steps to reproduce: 1. Add a RadPivotGrid to a form and populate it with data or use the one in the Demo application 2. Press Ctrl+A to select all cells 3, Press Ctrl+C to copy all cells to the clipboard You will get an exception.
Workaround: private IList<PivotGroupNode> collapsedRowsNodes; private void customMenuItem_Click(object sender, EventArgs e) { PivotGridSpreadExport spreadExport = new PivotGridSpreadExport(pivotGrid); spreadExport.ExportCompleted += spreadExport_ExportCompleted; spreadExport.ExportFlatData = true; this.collapsedRowsNodes = new List<PivotGroupNode>(); PivotGridGroupTraverser rowTraverser = (PivotGridGroupTraverser)this.pivotGrid.PivotGridElement.RowScroller.Traverser.GetEnumerator(); while (rowTraverser.MoveNext()) { PivotGroupNode current = rowTraverser.Current; if (!current.Expanded) { this.collapsedRowsNodes.Add(current); current.Expanded = true; } } spreadExport.RunExport(@"..\..\export.xlsx", new SpreadExportRenderer()); } private void spreadExport_ExportCompleted(object sender, EventArgs e) { foreach (PivotGroupNode node in this.collapsedRowsNodes) { node.Expanded = false; } }
Check the attached screenshot:
To reproduce: Resize some of the columns in PivotGrid and then export it with PivotExporttoExcelML. All columns in exported file have the same width. Workaround: Use PivotGridSpreadExport.
To reproduce: Add a RadPivotGrid and a few columns, select one column and show the PrintingDialog. Select "Print Selection Only", exception will occur. Workaround: Use the following print style - public class MyPrintStyle : PivotGridPrintStyle { private Func<Rectangle, SizeF> getScaleFactors; private Func<int, Rectangle, float, int> getStartColumn; private Func<int, Rectangle, float, int> getEndColumn; private Func<int, Rectangle, float, int> getStartRow; private Func<int, Rectangle, float, int> getEndRow; private List<AggregateDescriptionBase> aggregates; private List<int> columnWidths; private List<int> rowHeights; private Type baseType; private BindingFlags flags; public override void Initialize() { base.Initialize(); this.baseType = typeof(PivotGridPrintStyle); this.flags = BindingFlags.NonPublic | BindingFlags.Instance; this.getScaleFactors = this.GetFuncFromParent<Rectangle, SizeF>("GetScaleFactors"); this.getStartColumn = this.GetFuncFromParent<int, Rectangle, float, int>("GetStartColumn"); this.getEndColumn = this.GetFuncFromParent<int, Rectangle, float, int>("GetEndColumn"); this.getStartRow = this.GetFuncFromParent<int, Rectangle, float, int>("GetStartRow"); this.getEndRow = this.GetFuncFromParent<int, Rectangle, float, int>("GetEndRow"); this.aggregates = GetField<List<AggregateDescriptionBase>>("aggregates"); this.columnWidths = GetField<List<int>>("columnWidths"); this.rowHeights = GetField<List<int>>("rowHeights"); } private T GetField<T>(string name) { return (T)this.baseType.GetField(name, flags).GetValue(this); } private Func<T, TResult> GetFuncFromParent<T, TResult>(string method) { MethodInfo getScaleFactor = baseType.GetMethod(method, flags); var func = (Func<T, TResult>)Delegate.CreateDelegate(typeof(Func<T, TResult>), this, getScaleFactor); return func; } private Func<T1, T2, T3, TResult> GetFuncFromParent<T1, T2, T3, TResult>(string method) { MethodInfo getScaleFactor = baseType.GetMethod(method, flags); var func = (Func<T1, T2, T3, TResult>)Delegate.CreateDelegate(typeof(Func<T1, T2, T3, TResult>), this, getScaleFactor); return func; } public override void DrawPage(Rectangle drawArea, Graphics graphics, int pageNumber) { int x = drawArea.X; int y = drawArea.Y; SizeF scale = this.getScaleFactors(drawArea); int startColumn = this.getStartColumn(pageNumber, drawArea, scale.Width); int endColumn = this.getEndColumn(startColumn, drawArea, scale.Width); int startRow = this.getStartRow(pageNumber, drawArea, scale.Height); int endRow = this.getEndRow(startRow, drawArea, scale.Height); int aggregateIndex = 0; for (int i = startRow; i <= endRow; i++) { x = drawArea.X; int maxHeight = 0; for (int j = startColumn; j <= endColumn; j++) { if (j == 0 && i == 0 && aggregateIndex < this.aggregates.Count) { while (aggregateIndex < this.aggregates.Count) { if (j >= this.columnWidths.Count || i >= this.rowHeights.Count) { break; } Rectangle aggregateElementRect = new Rectangle(x, y, this.columnWidths[j], this.rowHeights[i]); RadPrintElement aggregatePrintElement = this.GetAggregateDescriptorCell(aggregateIndex++); aggregatePrintElement.ScaleTransform = scale; RectangleF aggregateTransformedRect = aggregatePrintElement.GetTransformedBounds(aggregateElementRect); this.PrintElement(aggregatePrintElement, drawArea, aggregateElementRect, graphics); x += (int)Math.Floor(aggregateTransformedRect.Width); maxHeight = Math.Max(maxHeight, (int)Math.Floor(aggregateTransformedRect.Height)); if (aggregateIndex < this.aggregates.Count) { j++; } } continue; } Rectangle elementRect = new Rectangle(x, y, this.columnWidths[j], this.rowHeights[i]); RadPrintElement printElement = this.GetPrintElementForCell(i, j); printElement.ScaleTransform = scale; RectangleF transformedRect = printElement.GetTransformedBounds(elementRect); this.PrintElement(printElement, drawArea, elementRect, graphics); x += (int)Math.Floor(transformedRect.Width); maxHeight = Math.Max(maxHeight, (int)Math.Floor(transformedRect.Height)); } y += maxHeight; } } }
If you have an object with string property and for all the available objects in the RadPivotgrid you have numeric values for this property with leading zero digits (e.g. "002"), it is exported in Excel as a numeric cell.
The issue may manifest if aggregate descriptions are added on the pivot`s column axis and if their member does not return data.
Workaround: public Form1() { InitializeComponent(); this.radPivotGrid1.GroupDescriptorElementCreating += radPivotGrid1_GroupDescriptorElementCreating; } private void radPivotGrid1_GroupDescriptorElementCreating(object sender, Telerik.WinControls.UI.GroupDescriptorElementCreatingEventArgs e) { e.GroupDescriptorElement.FilterPopup.PopupOpened -= FilterPopup_PopupOpened; e.GroupDescriptorElement.FilterPopup.PopupOpened += FilterPopup_PopupOpened; } private void FilterPopup_PopupOpened(object sender, EventArgs args) { PivotGroupFilterPopup filterPopup = (PivotGroupFilterPopup)sender; RadTreeView tree = filterPopup.TreeViewMenuItem.TreeElement.TreeView; ((RadScrollBarElement)tree.TreeViewElement.Children[2]).Value = 10; ((RadScrollBarElement)tree.TreeViewElement.Children[2]).Value = 0; }
How to reproduce: check the attached project and select an item from the drop-down list
Workaround: private void radPivotGrid1_GroupDescriptorElementCreating(object sender, Telerik.WinControls.UI.GroupDescriptorElementCreatingEventArgs e) { e.GroupDescriptorElement.FilterPopup.PopupOpened -= FilterPopup_PopupOpened; e.GroupDescriptorElement.FilterPopup.PopupOpened += FilterPopup_PopupOpened; } private void FilterPopup_PopupOpened(object sender, EventArgs args) { PivotGroupFilterPopup filterPopup = (PivotGroupFilterPopup)sender; RadTreeView tree = filterPopup.TreeViewMenuItem.TreeElement.TreeView; int height = this.CalculateHeight(tree); if (height > tree.Height) { ((RadScrollBarElement)tree.TreeViewElement.Children[2]).Value = 0; ((RadScrollBarElement)tree.TreeViewElement.Children[2]).Maximum = height; ((RadScrollBarElement)tree.TreeViewElement.Children[2]).Visibility = Telerik.WinControls.ElementVisibility.Visible; } } private int CalculateHeight(RadTreeView tree) { int height = 0; for (int i = 0; i < tree.Nodes[0].Nodes.Count + 1; i++) { height += tree.ItemHeight; } return height; }
Workaround: public Form1() { InitializeComponent(); this.radPivotGrid1.GroupDescriptorElementCreating += radPivotGrid1_GroupDescriptorElementCreating; } private void radPivotGrid1_GroupDescriptorElementCreating(object sender, Telerik.WinControls.UI.GroupDescriptorElementCreatingEventArgs e) { FieldInfo fi = e.GroupDescriptorElement.GetType().GetField("filterPopup", BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); fi.SetValue(e.GroupDescriptorElement, new MyPivotGroupFilterPopup(e.GroupDescriptorElement) { Visible = false }); e.GroupDescriptorElement.SortDirectionArrow.Visibility = ElementVisibility.Collapsed; } public class MyPivotGroupFilterPopup : PivotGroupFilterPopup { public MyPivotGroupFilterPopup(PivotGroupDescriptorElement pivotGroupDescriptorElement) : base(pivotGroupDescriptorElement) { } protected override void LoadSettings() { base.LoadSettings(); this.Items.Remove(SortAZMenuItem); this.Items.Remove(SortZAMenuItem); this.Items.Remove(SortOptionsMenuItem); } }