Click here to Skip to main content
14,668,823 members
Rate this:
Please Sign up or sign in to vote.
See more:
How can print multiple records of a listview.
PrintVisual only provide image of a specific size or view (where you stand at a time).

Please help to print multiple records with the help of printvisual or any other method.

i'm new in wpf please explain in brief if any one know(My listview binds with other user control and repeat this use control according to data size)
Posted

Rate this:
Please Sign up or sign in to vote.

Solution 1

To print multiple pages you just need to use a class that implements DocumentPaginator FixedDocument is one of the more complex implementations, FlowDocument is a simpler one.

FlowDocument fd = new FlowDocument();
foreach(object item in items)
{
    fd.Blocks.Add(new Paragraph(new Run(item.ToString())));
}
fd.Print();
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

As an alternative, there is a simple solution using PrintDialog class as:
PrintDialog pd = new PrintDialog();
pd.PrintDocument(fd);
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100