RadPrintDocument / Print / PrintPreview

7 posts, 1 answers
  1. Philip
    Philip avatar
    4 posts
    Member since:
    Jul 2015

    Posted 08 Mar Link to this post

    Is it possible to start each "grouping" of data on a new page when printing?

     

    I can see simple properties for printing headers at the top of each page, printing the "grouping" column but nothing stands out to perform a page break for each grouping (in my case days of the week).

  2. Answer
    Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 09 Mar Link to this post

    Hello Phil,

    Thank you for writing.

    With the current implementation, the printing engine in RadGridView lacks this type of functionality. However, I managed to prepare a sample implementation with which you could achieve the desired result.

    Basically, you would need to create a custom GridPrintStyle in order to properly calculate the number of pages. The new class will work together with a custom print renderer responsible for the actual drawing of the page. Please find attached my sample project as well a short video showing the result on my end.

    I hope this helps. Please let me know if you need further assistance.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Philip
    Philip avatar
    4 posts
    Member since:
    Jul 2015

    Posted 09 Mar in reply to Hristo Merdjanov Link to this post

    Absolutely great - many thanks :-)
  5. Jeff
    Jeff avatar
    2 posts
    Member since:
    Feb 2016

    Posted 10 Mar Link to this post

    I have been looking for this exact feature, however it doesn't seem to be functioning properly. I get the 5 pages, but everything is on the first page. I have 5 groups with 3 items. Any ideas on how to debug this?

     

    Thanks,

    Jeff

  6. Philip
    Philip avatar
    4 posts
    Member since:
    Jul 2015

    Posted 11 Mar Link to this post

    Hi Jeff

    What type is your grid view definition?  The code was for a TableViewDefinition. Is yours a ColumnsViewGroupDefinition?

    Put a breakpoint in InitializePrintRenderer() to see.

    If that is the case could Hristo supply a sample ColumnGroupsViewDefinitionPrintRenderer that does something similar?

    Cheers

    Phil

  7. Philip
    Philip avatar
    4 posts
    Member since:
    Jul 2015

    Posted 13 Mar Link to this post

    Jeff

    Alternatively if the view definition is a TableViewDefinition, yet the first page could fit multiple groups on it then try changing the following line:

                    if ((traverser.Current is GridViewGroupRowInfo) && pageNumber > 1 && !firstRow)

    to 

                    if ((traverser.Current is GridViewGroupRowInfo) && pageNumber >= 1 && !firstRow)

    Cheers

    Phil

  8. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 14 Mar Link to this post

    Hi guys,

    Thank you for writing.

    Jeff, could you please let us know in more details about your local setup and in what particular scenario you are experiencing difficulties?

    Looking forward to your reply.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready