Click here to Skip to main content
16,021,169 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Please give the code only for current form to print
Posted
Comments
Suvabrata Roy 4-Jul-14 2:37am    
Please elaborate more your question is not clear
Member 10918392 4-Jul-14 2:47am    
My code is print the form for multiples time
But i want to print for only 1 time

the printing code i used is

XtraReport1 report = new XtraReport1();

using (ReportPrintTool printTool = new ReportPrintTool(report))
{

printTool.PrintDialog();


printTool.Print();


printTool.Print("HP LaserJet Professional P1606dn");
}
plese rectify it
Suvabrata Roy 4-Jul-14 2:50am    
you are using in desktop or in web
Member 10918392 4-Jul-14 2:57am    
desktop

1 solution

Hi,

XtraReport1 report = new XtraReport1();
 
using (ReportPrintTool printTool = new ReportPrintTool(report))
{
 
printTool.PrintDialog();
 

printTool.Print("HP LaserJet Professional P1606dn");// Provide the printer name 
}


Fro More help use guidelines : https://documentation.devexpress.com/#WindowsForms/DevExpressXtraPrintingPrintTool_Printtopic1903[^]
 
Share this answer
 
Comments
Member 10918392 4-Jul-14 3:15am    
Already i am having this code.
Suvabrata Roy 4-Jul-14 3:54am    
No there is a small difference
Member 10918392 4-Jul-14 4:15am    
nothing difference the same code and the same printer name only i used.

Thanks for your support.
Member 10918392 4-Jul-14 4:16am    
http://www.codeproject.com/Answers/793067/How-to-get-current-form-to-print-with-only-one-cop#answer1

See the link above...
That question also i asked.
Member 10918392 4-Jul-14 4:28am    
Hai Suvabrata,
Now only i seen corectly ur solution.

It will work..
Thanks a lot friend.

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