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

  • Home
  • SEARCH
  • 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 6571487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:53:21+00:00 2026-05-25T14:53:21+00:00

I am new to Crystal Report and I have a problem I cannot figure

  • 0

I am new to Crystal Report and I have a problem I cannot figure out.
Because I cannot find an answer anywhere I try it this way.

I am using a Crystal Report which uses an ODBC database with a text driver as a datasource.
This report works perfect when opening it with the standalone Crystal Report XI.

When opening it via VS2010 over a basic c#-program I am always prompted for the Username and Password for this DB, in spite there is none of this.
Because of this I cannot access the data.

The strange thing is, that it is possible to access the data of the fields via “Browse Field Data” in the editor.

Is there something I am missing?

namespace CrystalReportsApplication1
{
    public partial class Form1 : Form
    {
        private string reportPath;
        private ReportDocument repDoc = new ReportDocument();
        private FileInfo m_AssemblyCS;
        private DirectoryInfo m_SolutionRoot;

        public Form1()
        {
            InitializeComponent();
            m_AssemblyCS = new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
            m_SolutionRoot = m_AssemblyCS.Directory.Parent.Parent.Parent;
            reportPath = string.Empty;
        }

        private void bOpenReport_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.InitialDirectory = m_SolutionRoot.FullName;
            openFileDialog1.Filter = "rpt files (*.rpt)|*.rpt|All files (*.*)|*.*";

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            { 
                reportPath = openFileDialog1.FileName;
                tbReportPath.Text = reportPath;
                repDoc.Load(reportPath);
                crystalReportViewer.ReportSource = repDoc;
            }
        }
    }
}

Update

Unfortunately the se hasn’t helped. I still get the error. I tried to following:

private void bOpenReport_Click(object sender, EventArgs e)
{
  OpenFileDialog openFileDialog1 = new OpenFileDialog();
  openFileDialog1.InitialDirectory = m_SolutionRoot.FullName;
  openFileDialog1.Filter = "rpt files (*.rpt)|*.rpt|All files (*.*)|*.*";

  if (openFileDialog1.ShowDialog() == DialogResult.OK)
  { 
    reportPath = openFileDialog1.FileName;
    tbReportPath.Text = reportPath;
    repDoc.Load(reportPath);

    foreach(Table table in repDoc.Database.Tables)
      SetConnectionInfo(table.Name, "dds", "", "", "");

    crystalReportViewer.ReportSource = repDoc;
  }
}

private void SetConnectionInfo(string table, string server, string database, string user, string password)
{ 
  TableLogOnInfo logOnInfo = new TableLogOnInfo();
  logOnInfo = repDoc.Database.Tables[table].LogOnInfo;
  ConnectionInfo connectionInfo = new ConnectionInfo();
  connectionInfo = logOnInfo.ConnectionInfo;

  connectionInfo.DatabaseName = database;
  connectionInfo.ServerName = server;
  connectionInfo.Password = password;
  connectionInfo.UserID = user;
  repDoc.Database.Tables[table].ApplyLogOnInfo(logOnInfo);
}

The connectionInfos of the tables are set, but I still get the login-dialog.

  • 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-05-25T14:53:21+00:00Added an answer on May 25, 2026 at 2:53 pm

    Have a look at the answer of the following question:
    How do I change a Crystal Report's ODBC database connection at runtime?

    We normally supply the connection credentials via the “Part2” mentioned there using
    CrystalDecisions.Shared.ConnectionInfo object.
    Normally you do not have user/password on text files so maybe providing empty/empty works.

    Looks like there is another question where the guy had the same issue and solved it as follows:
    visusal studio embedded crystal report keeps prompting database login?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi column report in crystal report.Is there any way to start
hi i am new to crystal reports and ASP.NET I have a crystal report
When designing a new Crystal Report you have to create a new database connection.
I have a very simple Crystal report document which pulls data from a db
I have a crystal report written in 10 with two parameter fields start_date end_date
We have a crystal report (2011) that was running fine until we changed our
I am trying to create a crystal report and I am new to that
i have an app which has btn to preview report made in crystal report.
I have a sql stored procedure which is attached to a crystal report. The
I have written the following code as, Dim report As New ReportDocument report.PrintOptions.PrinterName =

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.