7

I've been attempting to get this working for a while now, and I've had no luck. I have a datagrid (although this could change to anything if it makes it easier) that contains a long list of items.

What i'm wanting to do, is print out this list of items, keeping the grouping and group headers, however i'm unable to find any solution to this issue as all examples and solutions simply convert the datasource into a table, which dosn't keep the grouping.

I've tried several solutions such as: http://www.codeproject.com/Articles/138233/Custom-Data-Grid-Document-Paginator

However I'm not sure enough of the structure of datagrids to modify the source to include groups. I'm hoping that since this seems like a pretty common thing to want to do, that some existing solutions could be suggested.

Ben
  • 1,291
  • 2
  • 15
  • 36
  • 1
    Another way to do this would be to use the winforms reportviewer. See [this](http://stackoverflow.com/questions/17709811/how-to-add-rdlc-file-to-reportviewer-in-wpf-projects) and [this](http://msdn.microsoft.com/en-us/library/hh273267.aspx) – jamesSampica Oct 21 '13 at 18:26
  • How do you print? Have you tried print visual? – Emad Feb 22 '16 at 13:48
  • If you know how many rows fits into one page (or can calculate it), you can print a WPF control as-is, using XpsDocumentWriter – lena Dec 07 '16 at 14:18

1 Answers1

0

It will be better to use a third party control like xceed or devxpress to do this. Or otherwise free one is http://wpfextendeddatagrid.codeplex.com/

ViBi
  • 515
  • 7
  • 19