Trying to print a report but the crystalreports.engine can't find default printer

Last post 07-03-2009 6:30 AM by v.vivek. 3 replies.

Sort Posts:

  • Trying to print a report but the crystalreports.engine can't find default printer

    12-13-2003, 10:31 PM
    • Member
      360 point Member
    • poc1010
    • Member since 11-09-2003, 4:40 PM
    • Posts 72
    Hi,

    Does anybody know how to fix the below printing problem. I trying to print a report but I get the following message:



    Error in File C:\WINNT\TEMP\temp_5ab9b327-6ad7-45f3-8d25-9b3993c2b695.rpt: No default printer.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: CrystalDecisions.CrystalReports.Engine.PrintException: Error in File C:\WINNT\TEMP\temp_5ab9b327-6ad7-45f3-8d25-9b3993c2b695.rpt: No default printer.

    Source Error:


    Line 87:
    Line 88: 'Dim myReport As New CrystalReport1()
    Line 89: myReport.PrintToPrinter(1, False, 1, 99)
    Line 90: End Sub
    Line 91: End Class




    Stack Trace:


    [PrintException: Error in File C:\WINNT\TEMP\temp_5ab9b327-6ad7-45f3-8d25-9b3993c2b695.rpt:
    No default printer.]
    .K(String 
    , EngineExceptionErrorID  )
    .F(Int16 , Int32 )
    .E(Int16 )
    CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
    CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
    System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess) +0
    System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess) +329
    System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +23
    System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +14
    Microsoft.VisualBasic.CompilerServices.LateBinding.FastCall(Object o, MethodBase method, ParameterInfo[] Parameters, Object[] args)
    Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
    Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
    PerfumesOnLine.Order_Confirm.PrintOrder_Click(Object sender, EventArgs e) in C:\PerfumesOnLine\Order_Confirm.aspx.vb:89
    System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    System.Web.UI.Page.ProcessRequestMain() +1263


  • Re: Trying to print a report but the crystalreports.engine can't find default printer

    07-01-2009, 4:01 AM

    Hi.. I am also getting this error message... does anyone knows how to resolve this issue... thanks 

  • Re: Trying to print a report but the crystalreports.engine can't find default printer

    07-03-2009, 3:26 AM
    • Member
      24 point Member
    • btough
    • Member since 05-08-2009, 10:02 AM
    • India
    • Posts 52

     Check your printer settings from Printer and Faxes. Select the default printer you use to print.

    Thanks,

    -YogP.

  • Re: Trying to print a report but the crystalreports.engine can't find default printer

    07-03-2009, 6:30 AM
    • Member
      262 point Member
    • v.vivek
    • Member since 06-25-2009, 6:50 AM
    • Posts 52

    i thik this two link will help u..

    set the printer name.

    string PrinterName = this.printDocument1.PrinterSettings.PrinterName;
    crReportDocument.PrintOptions.PrinterName = PrinterName;


    http://www.codeproject.com/KB/printing/printtoprinter.aspx

    http://aspalliance.com/509_Automatically_Printing_Crystal_Reports_in_ASPNET.2

    Thanks..
    Vivek Vishal

    Please Mark As Answer If This Post Help You To Find Your Solution.
Page 1 of 1 (4 items)