How to print WPF Grid?
I am printing WPF grid. As long as the data fits on one page, everything works fine. But sometimes the grid contains more data. So I need to split the grid into multiple pages. Can anyone help me?
My code looks like this (visual grid).
var printCapabilities = printDialog.PrintQueue.GetPrintCapabilities(printDialog.PrintTicket);
var size = new Size(printCapabilities.PageImageableArea.ExtentWidth,
printCapabilities.PageImageableArea.ExtentHeight);
visual.Measure(size);
visual.Arrange(new Rect(new Point(printCapabilities.PageImageableArea.OriginWidth,
printCapabilities.PageImageableArea.OriginHeight), size));
printDialog.PrintVisual(visual, "Print ListView");
Should I try a different control? I tried WPF Toolkit DataGrid but I was unable to print it. I've heard something about streaming document, can this help me?
Best wishes - Oliver Hanappie
+2
source to share