Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear:
I have report viewer, but I don't want to use the report viewer print button,because the print button can not work as I want.so I want to create new print button and write code to print direct to default printer...Could you help me? Thank in advanced...
Posted

1 solution

Hi my friend.
This code might be useful:
C#
PrintDocument printDoc= new PrintDocument();
/* do some work for drawing and writing things on printDoc here */
// printDoc has some properties and methods for setting margin, drawing and ...
PrintDialog pd = new PrintDialog();
pd.Document = printDoc;
if (pd.ShowDialog() == DialogResult.OK)
printDoc.Print();
 
Share this answer
 
Comments
kornkimhour 30-Jun-12 0:56am    
Thank for reply me friend, but how can I work Data Report Viewer with Print Document...Thank In advanced........

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