0

I've been searching the web for over 2 days now for a good and easy to use something to print reports from a WPF application.

I've been trying to use the DocumentViewer but it's a pain to add Controls to it and style them. Is it me or can this only be done in code behind and how can a grid over multiple pages dynamically be generated?

Second I found the control FlowDocumentReader. This looks like an interesting thing since you can add Tables which are much easier to style and I was able to do this in xaml. Unfortunately, I have no clue how to print from it. I tried to edit the template of the reader but without success.

Last I found this post (What's the best approach to printing/reporting from WPF?) but it's dated to 2008 so I'm not sure if the information is still accurate.

My conclusion is that it is pretty hard to get a nice looking report printed from WPF without writing lots of code behind or editing templates which (by me) fail to do what I want.

So my question is, is there any good approach to my problem? I'm really bothered that I lost this much time for something that I thought was so trivial to do.

I was wonder, what about this guy's approach: https://stackoverflow.com/questions/17647939/how-do-we-handle-different-printing-needs-by-using-fixeddocument?rq=1?

Community
  • 1
  • 1
Krowi
  • 1,565
  • 3
  • 20
  • 40
  • 1
    Is there a reason you dont want to use Crystal Reports, MS Reports or another 3rd party reporting system? – Steve Mar 27 '14 at 19:10
  • No, I just did not hear about those yet. I'll have a look at them. Tnx. – Krowi Mar 27 '14 at 20:17

1 Answers1

1

Crystal Reports is indeed a good choice for complicated reports but if your reports will be simple in design I'll recommend using CodeReason reports, it's an xaml based reports. Too bad it's not updated anymore but it's really easy to use for simple reports.

For more information: http://wpfreports.codeplex.com/

jack
  • 1,103
  • 2
  • 10
  • 18