Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

Crystal report not loading. login failed for the user sa in event viewer.

$
0
0

Hello All,

i am trying to implement a simple crystal report. the code is running with out any error but the report is not displaying. When i check it on event viewer i am getting login failed for the user sa each time i try to access the report. 

I can able to get the data while creating the report in the main report preview but when i am trying to access it through web browser its showing nothing.

This is how i have implemented the code. i have downloaded this.

http://postimg.org/image/53978mpcf/

<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
            AutoDataBind="true" />
  protected void Page_Load(object sender, EventArgs e)
    {
        ReportDocument rptDoc = new ReportDocument();
        dsTestCrystal ds = new dsTestCrystal();
        DataTable dt = new DataTable();
        dt.TableName = "Crystal Report Example";
        dt = getAllOrders().Tables[0];
        ds.Tables[0].Merge(dt);
        rptDoc.Load(Server.MapPath("SimpleCrystal.rpt"));
        rptDoc.SetDataSource(ds);
        CrystalReportViewer1.ReportSource = rptDoc;
    }
    public DataSet getAllOrders()
    {
        string sqlCon = ConfigurationManager.AppSettings["conStr1"].ToString();
        SqlConnection Con = new SqlConnection(sqlCon);
        SqlCommand cmd = new SqlCommand();
        DataSet ds = null;
        SqlDataAdapter adapter;
        try
        {
            Con.Open();
            cmd.CommandText = "getAllOrders";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection = Con;
            ds = new DataSet();
            adapter = new SqlDataAdapter(cmd);
            adapter.Fill(ds, "Users");
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        finally
        {
            cmd.Dispose();
            if (Con.State != ConnectionState.Closed)
                Con.Close();
        }
        return ds;
    }

<?xml version="1.0"?><!-- For more information on how to configure your ASP.NET application, please visithttp://go.microsoft.com/fwlink/?LinkId=169433 --><configuration><configSections><sectionGroup name="businessObjects"><sectionGroup name="crystalReports"><section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null"/></sectionGroup></sectionGroup></configSections><appSettings><add key="conStr" value="User ID=sa;PWD=sa997; server=.;INITIAL CATALOG=Test_DB;" /><add key="conStr1" value="User ID=sa;PWD=sa997; server=.;INITIAL CATALOG=Test_DB;" /><add key="CrystalImageCleaner-AutoStart" value="true" /><add key="CrystalImageCleaner-Sleep" value="60000" /><add key="CrystalImageCleaner-Age" value="120000" /></appSettings><connectionStrings><add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/></connectionStrings><system.web><compilation debug="true" targetFramework="4.0"><assemblies><add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies><buildProviders><add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></buildProviders></compilation><authentication mode="Forms"><forms loginUrl="~/Account/Login.aspx" timeout="2880"/></authentication><membership><providers><clear/><add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/></providers></membership><profile><providers><clear/><add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/></providers></profile><roleManager enabled="false"><providers><clear/><add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/><add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/></providers></roleManager><httpHandlers><add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></httpHandlers></system.web><system.webServer><modules runAllManagedModulesForAllRequests="true"/><handlers><add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/></handlers><validation validateIntegratedModeConfiguration="false"/></system.webServer><businessObjects><crystalReports><rptBuildProvider><add embedRptInResource="true"/></rptBuildProvider></crystalReports></businessObjects></configuration>


please help i am new to this. 

Thanks


Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>