Introduce DataBase,Asp.net,JavaScript,Xml,Html,Css,Sql,Php,ASP.NET Controls,AJAX,Tools,HTML,CSS,JavaScript,Open Source Project,WPF,.Net Framework,Linq
Top Recommended Hosting

Unable to connect: incorrect log on parameters

by the3factory 5/6/2008 8:32:00 AM
Question:

 hi

 After publishing my website when i click on the print button then giving error like ---

CrystalDecisions.CrystalReports.Engine.LogOnException: Error in File C:\DOCUME~1\SSSHEL~1\LOCALS~1\Temp\RptOfferLetter {4B019917-4D0A-40D1-AC7A-B1E696C8C4B3}.rpt: Unable to connect: incorrect log on parameters. ---> System.Runtime.InteropServices.COMException (0x8004100F): Error in File C:\DOCUME~1\SSSHEL~1\LOCALS~1\Temp\RptOfferLetter {4B019917-4D0A-40D1-AC7A-B1E696C8C4B3}.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.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) at CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext) 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 Reports_RptOfferLetter.Print() in d:\Subhash\NewDWD\Reports\RptOfferLetter.aspx.cs:line 88

--> if same website i run without publish then its working fine.

i m using this method for print report

protected void btnPrint_Click(object sender, EventArgs e)
    {
               
        GetPaperSource();
        SepPrintOptions();
        Print();
    }

    private ArrayList GetPaperSource()
    {
        ArrayList arraylist = new ArrayList();
        System.Drawing.Printing.PrinterSettings printersettings = new System.Drawing.Printing.PrinterSettings();
        printersettings.PrinterName = CURRENT_PRINTER;
        foreach (System.Drawing.Printing.PaperSource papersource in printersettings.PaperSources)
        {
            arraylist.Add(papersource.SourceName.ToString());
        }
        return arraylist;
    }

    private void SepPrintOptions()
    {
       
        diskFileDestinationOptions = new DiskFileDestinationOptions();
        hierarchicalGroupingReport = new ReportDocument();

        if (Session["Month"] != null && Session["State"] != null && Session["HQ"] == null && Session["Name"] == null)
        {
            hierarchicalGroupingReport.Load(Server.MapPath("~/Reports/RptSalSlipStwise.rpt"));
        }
       
        hierarchicalGroupingReport.SetParameterValue("@SalMonth", Session["Month"]);
       

        printopction = hierarchicalGroupingReport.PrintOptions;
        printopction.PrinterName = CURRENT_PRINTER;
    }

    private void Print()
    {
        try
        {
            message.Visible = true;
            hierarchicalGroupingReport.SetDatabaseLogon("sa", "pass#word1", "TISERVER", "DWD");
            hierarchicalGroupingReport.PrintToPrinter(1, false, 1, 99);
        }
        catch (Exception ex)
        {
            message.Text = "Print Error:File not Found";
        }
    }
 

 Please help me as soon as possible.

Subhash. 


Answer1:

I am having the same problem. Did you find a solution already?


Answer2:

Hi pitkonijn,

 Try this. If you are viewing crystal report using web application & used Crystal Report is using ODBC connection to connect to Database then do following:

  1. Open SQL Server Management Studio
  2. Select database engine (server) where database is created.
  3. Select “Security” folder. Followed by “Logins” folder.
  4. Check if there is “<server name>\ASPNET” as user exists.
    • If not then right click on “Logins” folder & select “New Login”.
    • User “Search” button if you want to make sure correct username path is added to the “Logins” list.
 Crystal report uses ASPNET user hence SQL server must user login for ASPNET account. Hope this helps.Regards,Hash

Answer3:

Hash,

 Thank you for your time. In the mean time, I learned that the error message "Unable to connect: incorrect log on parameters" is not very specific to this problem. I thought I was having the same problem as the one described above, but in the end, it turned out to be a different one ...

Regards


Related posts

Sign up for PayPal and start accepting credit card payments instantly.


Powered by BlogEngine.NET 1.2.0.0