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).
6 Answers, 1 is accepted
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
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
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
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
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