Row headers columns size on print

3 posts, 0 answers
  1. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 04 Oct Link to this post

    Hi,

    when I print PivotGrid - all Row headers columns have same size, is it possible to print them similar size like on the screen? Like for datacells columns, see attached

    Alex

  2. Hristo
    Admin
    Hristo avatar
    716 posts

    Posted 06 Oct Link to this post

    Hi Alex,

    Thank you for writing.

    Indeed, the row headers are not printed with the desired width. I have logged this issue in our feedback portal and I have also added a vote for it on your behalf. You can subscribe to the item and be notified with its status changes here: FIX. RadPivotGrid - row headers width should be respected when the pivot is being printed. I have also updated your Telerik points.

    The issue will be fixed with our upcoming release scheduled for the end of the month. Until then you would need to use a custom PivotGridPrintStyle class and override its Initialize method: 
    private void PrintPivotGrid()
    {
        MyPivotGridPrintStyle style = new MyPivotGridPrintStyle();
        style.LayoutType = PivotLayout.Tabular;
        this.radPivotGrid1.PrintStyle = style;
        this.radPivotGrid1.PrintPreview();
    }
    public class MyPivotGridPrintStyle : PivotGridPrintStyle
    {
        public override void Initialize()
        {
            base.Initialize();
     
            FieldInfo fiColumnWidths = this.GetType().BaseType.GetField("columnWidths", BindingFlags.Instance | BindingFlags.NonPublic);
            List<int> columnWidths = (List<int>)fiColumnWidths.GetValue(this);
            RadPivotGridElement pivotGrid = (RadPivotGridElement)this.GetType().BaseType.GetField("pivotGrid", BindingFlags.Instance | BindingFlags.NonPublic)
                                                                                        .GetValue(this);
     
            for (int i = 0; i < pivotGrid.RowDescriptorsArea.Children.Count; i++)
            {
                RadElement descriptor = pivotGrid.RowDescriptorsArea.Children[i];
                columnWidths[i] = descriptor.Size.Width;
            }
        }
    }

    I hope this helps. Please let me know if you have further questions.

    Regards,
    Hristo Merdjanov
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 12 Oct in reply to Hristo Link to this post

    Thanks Hristo, works fine!

     

    Alex

     

Back to Top