Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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.

C#
FlowDocument fd = new FlowDocument();
foreach(object item in items)
{
    fd.Blocks.Add(new Paragraph(new Run(item.ToString())));
}
fd.Print();
 
Share this answer
 
As an alternative, there is a simple solution using PrintDialog class as:
C#
PrintDialog pd = new PrintDialog();
pd.PrintDocument(fd);
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900