Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a problem btnPRINT_Click in windows application in visual studio 2005 using crystal reports

Pls help me,

Whenever its comin this line crReportDocument.PrintToPrinter(1, true, 1, 1);

Its throwing CATCH exception....

Please resolve my issue....
Posted
Updated 17-Jan-12 21:00pm
Comments
thatraja 18-Jan-12 3:04am    
What's the exception message?
yasotharathinam 5-Feb-12 7:11am    
CrystalDecisions.CrystalReports.Engine.LogOnException:
Error in File C:\DOCUME~1\Yasotha\LOCALS~1\Temp\temp_4b950549-f705-817f-26401cc52a53 {B33C33BC-E04D-4987-BAF0-33722D 380376}.rpt:
Unable to connect: incorrect log on parameters. --> System.Runtime.InteropServices.COMException (0x8004100F):
Error in File C:\DOCUME~1\Yasotha\LOCALS~1\Temp\temp_4b950549-f705-817f-26401cc52a53 {B33C33BC-E04D-4987-BAF0-33722D 380376}.rpt:
Unable to connect: incorrect log on parameters.
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetLastPageNumber(RequestContext.pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext.reqContext)
-- End of inner exception stack trace --
at CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
at CSWindowsBoth.MainMenu.btnPrint_Click(Object sender, EventArgs e) in C:\New Folder\Yaso\vs 2005 pjt\CSWindowsBoth\CSWindowsBoth\MainMenu.cs:line 351


IMPORTANT:
----------
That - 351 - line is : crReportDocument.PrintToPrinter(1,true,1,1);
thatraja 5-Feb-12 10:42am    
Check my answer
yasotharathinam 16-Feb-12 11:04am    
I am getting another error,,
Please solve my issue.

Whenever i am clicking btnPrint_Click()

its throwing ex message..

System.ComponentModel.Win32Exception: The RPC Server is unavailable...
at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
at Etc......................,,,
thatraja 16-Feb-12 11:40am    
Check my updated 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