I have a DataTable containing an arbitrary number of columns and rows which I am trying to print out. The best luck I've had so far is by putting the data into a Table and then adding the table to a FlowDocument.
So far so good. The problem I have right now is that the Table only "wants" to take up about half of the document's width. I've already set the appropriate values for the FlowDocument's PageWidth and ColumnWidth properties, but the Table doesn't seem to want to stretch to fill up the allotted space?
In order to set your FlowDocument contents to the full available widh you must first know the width of the page. The property you need to set that takes care of the content length is the ColumnWidth prop on the FlowDocument.
I usualy create a "PrintLayout" helper class to keep known presets for the Page width/hight and Padding. Wou can snif presets from Ms Word and fill more.
The class for PrintLayout
next on your FlowDocument you can set the presets
On Xaml
By code
I had some luck with this: How to set the original width of a WPF FlowDocument, although it only took up about 90% of the space.