Hi Sir,

Where do I post my queries on Crystal report. I'm confused where do I post. So Im posting my query into this forum.

Now my problem is when Im posting the build on LOCAL server the Crystal reports are working fine. But when Im posting it on the LIVE server it is asking me to enter the database password. I tried this problem by changing the property of 'Integrated Security to 'TRUE'..But still it is not working,.... Is there any way to resolve this....

Thanks
Abhishek.

Dani AI

Generated

— the behavior you describe (works locally, prompts for password on the live server) is almost always an authentication/context issue on the server rather than a Crystal bug. pointed you in the right direction with SetDatabaseLogon(), but two common gaps cause the prompt to keep appearing: the report (and any subreports) still have their original connection info saved inside the .rpt, and the IIS process identity on the live box does not have the Windows/SQL permissions you expect. Setting Integrated Security=true in a config file does not magically update the connection info that the report uses at runtime.

Checklist to troubleshoot and fix (run these on the live server):

  • Decide Windows auth vs SQL auth. If Windows auth, make the IIS app pool run as a domain account that has SQL permissions (or enable impersonation with appropriate credentials).
  • If using SQL auth, create a limited SQL login and pass its credentials to the report at runtime. Avoid relying on designer-saved credentials.
  • Apply credentials programmatically to every Table in the main report and to every Table in every subreport (Crystal does not propagate credentials automatically).
  • Ensure the same database provider and Crystal runtime (and bitness 32/64) are installed on the server as on your dev machine.
  • Clear “Save Data with Report” in the designer before deployment and call Refresh() after applying logon info.
  • Check SQL Server logs to see what authentication attempts are coming from the server — that will show whether Windows or SQL login attempts are being made and why they fail.

Example pattern (C#) — apply the same ConnectionInfo to all tables and subreports:

var rpt = new ReportDocument();
rpt.Load(Server.MapPath("~/Reports/MyReport.rpt"));

var ci = new ConnectionInfo { ServerName="SQLHOST", DatabaseName="DB", UserID="user", Password="pwd", IntegratedSecurity=false };

foreach (Table t in rpt.Database.Tables) { var li = t.LogOnInfo; li.ConnectionInfo = ci; t.ApplyLogOnInfo(li); }

foreach (Section s in rpt.ReportDefinition.Sections)
  foreach (ReportObject ro in s.ReportObjects)
    if (ro.Kind == ReportObjectKind.SubreportObject) {
      var sub = (SubreportObject)ro;
      var subdoc = sub.OpenSubreport(sub.SubreportName);
      foreach (Table t in subdoc.Database.Tables) { var li = t.LogOnInfo; li.ConnectionInfo = ci; t.ApplyLogOnInfo(li); }
    }

Cautions: do not hardcode credentials in source; store them encrypted in config or use a low‑privilege SQL account. If you still get prompts after applying the above, inspect the exact connection strings and SQL login failures on the server — that will pinpoint whether it’s a missing permission, wrong server/instance name, driver mismatch, or an unhandled subreport.

Recommended Answers

All 2 Replies

Hi Sir,,

Thanks for the solution. But I tried all these things but still it is asking the password. I'll mention again that it is happening only when Im uploading the Build on LIVE server...

Thanks
Abhishek

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.