Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8223199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:36:12+00:00 2026-06-07T14:36:12+00:00

I am generating a report, but the problem is even though I’ve supplied credentials,

  • 0

I am generating a report, but the problem is even though I’ve supplied credentials, when the form containing the CrystalReport opens up, it still asks me for them, and the worst part is, I don’t enter any thing in there, and just click finish, and it loads the report. So, if there is no need for credentials (or whatever) why is it asking me?

Here’s the code

    private void MainReport_Load(object sender, EventArgs e)
    {
        var constr = string.Empty;
        constr = Application.StartupPath;
        if (Generate.bForProjects)
            constr = Path.Combine(constr, @"Reports\Projects.rpt");
        else
            constr = Path.Combine(constr, @"Reports\Other.rpt");

        var myConInfo = new CrystalDecisions.Shared.TableLogOnInfo();
        reportDocument1.Load(constr);
        myConInfo.ConnectionInfo.DatabaseName = "ProjectData.mdb";
        myConInfo.ConnectionInfo.ServerName = Application.StartupPath + @"\Data\ProjectData.mdb";
        myConInfo.ConnectionInfo.Password = "";
        myConInfo.ConnectionInfo.UserID = "";
        reportDocument1.Database.Tables[0].ApplyLogOnInfo(myConInfo);

        reportDocument1.Refresh();

        crystalReportViewer1.ReportSource = reportDocument1;
        crystalReportViewer1.Width = this.Width - 50;
        crystalReportViewer1.Height = this.Height - 100;
    }

When the form loads, this screen pop ups

enter image description here

And, when this comes up, I don’t enter anything! That’s right! I just click finish and it loads the report perfectly! So, if it doesn’t needs anything, why the hel* is it asking me for a login?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:36:14+00:00Added an answer on June 7, 2026 at 2:36 pm

    We have lots of problems when we came to connect a crystal report to a different database to the one it was designed / created against. We ended up creating the following function to set it up correctly. It recursively sets the connection on all report tables and sub reports.

    Also I seem to remember we had problems if the report was designed with Integrated Windows Authentications, and run with a simple username and password. So we always made sure we designed the reports with a simple username and password connection to the database.

    private static void SetConnection(ReportDocument report, string databaseName, string serverName, string userName, string password)
    {
        foreach (Table table in report.Database.Tables)
        {
            if (table.Name != "Command")
            {
                SetTableConnectionInfo(table, databaseName, serverName, userName, password);
            }
        }
    
        foreach (ReportObject obj in report.ReportDefinition.ReportObjects)
        {
            if (obj.Kind != ReportObjectKind.SubreportObject)
            {
                return;
            }
    
            var subReport = (SubreportObject)obj;
            var subReportDocument = report.OpenSubreport(subReport.SubreportName);
            SetConnection(subReportDocument, databaseName, serverName, userName,  password);
        }
    }
    
    private static void SetTableConnectionInfo(Table table, string databaseName, string serverName, string userName, string password)
    {
        // Get the ConnectionInfo Object.
        var logOnInfo = table.LogOnInfo;
        var connectionInfo = logOnInfo.ConnectionInfo;
    
        // Set the Connection parameters.
        connectionInfo.DatabaseName = databaseName;
        connectionInfo.ServerName = serverName;
        connectionInfo.Password = password;
        connectionInfo.UserID = userName;
        table.ApplyLogOnInfo(logOnInfo);
    
        if (!table.TestConnectivity())
        {
            throw new ApplicationException(Resource.UnableToConnectCrystalReportToDatabase);
        }
    
        table.Location = Database + "." + "dbo" + "." + table.Location;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm generating a reporting services report from an ASP.NET (MVC) based application but am
Using Crystal Report 8.5 Generating a report from table1 My Crystal Report Output ID
When i am generating a report, I get java.sql.SQLException: ORA-08103: object no longer exists.Code
I received reports that a my report generating application was not working. After my
I am generating an ssrs report in my Silverlight application and I need to
I am generating PDF/HTML report from a BIRT template. I am using visibility property
The situation: I am generating reports using Report Builder 2.0 and a Report Model
I have HTML view using 2010 .NET, which I am generating in the report
I'm generating a query and report through VBA. I have an option of asking
I am using C++ and I am generating a csv file to report some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.