0

I would like to create a simple report that consists mainly of text and some charts. The application is like a wizard form, that has user enter information and create a word or similar document report in the end. There will be some charts that will be drawn from the information entered that should be displayed in the report as well.

thanks.

Ajay
  • 23
  • 3

2 Answers2

0

You could use the FlowDocument or FixedDocument classes. They do a lot of work for you, but creating what you describe would still require considerable coding.

Dweeberly
  • 4,668
  • 2
  • 22
  • 41
  • Thanks, is it possible to include charts in FixedDocument? – Ajay Jul 05 '16 at 20:43
  • It's been a while since I've messed with it but you should be able to embed just about anything you can in HTML or Word. The difference is that flow documents are non-paged and dynamically lay out their elements based on available space. Fixed documents are more Word or PDF like, they are page oriented and elements stay where you put them. – Dweeberly Jul 06 '16 at 19:15
  • thanks, btw, since you mention word-like, can you export to word from a Fixed document? – Ajay Jul 06 '16 at 21:44
  • I believe you can, you might want to take a look at http://www.bradcurtis.com/document-and-report-generation-using-xaml-wpf-data-binding-and-xps/ or http://stackoverflow.com/questions/6827573/how-to-export-flowdocument-to-docx-or-xls – Dweeberly Jul 06 '16 at 23:42
  • Thanks! much appreciated, that looks like exactly what I want. – Ajay Jul 07 '16 at 13:20
0

You could use a FlowDocument and inside it you can put an InlineUIContainer with the controls you need:

Example of InlineUIContainer with inside a textbox:

<InlineUIContainer BaselineAlignment="Bottom">
       <TextBox Text="{Binding Comm8RelGest}" />
</InlineUIContainer>

Example of InlineUIContainer with inside a chart:

<InlineUIContainer BaselineAlignment="Bottom">
       <crt:Chart Title="My Chart">
             <crt:ColumnSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding}" />
       </crt:Chart>
</InlineUIContainer>

Here some documentation about InlineUIContainer inside a FlowDocument: InlineUIContainer

Babbillumpa
  • 1,854
  • 1
  • 16
  • 21