I would suggest that the report is not using appropriate credentials to connect to the DB.
This needs to be set and passed to the report else it will run via the current context which is dependent on the account the Application Pool is running under.
The below code creates a Crystal ConnectionInfo & applies it to the Report
CrystalDecisions.Shared.ConnectionInfo connCrystal = new CrystalDecisions.Shared.ConnectionInfo();
connCrystal.ServerName = "MyServername";
connCrystal.DatabaseName = "MyDbName";
connCrystal.IntegratedSecurity = false;
connCrystal.UserID = "MyUserName";
connCrystal.Password = "MyPassword";
ReportDocument rptDoc = new ReportDocument();
rptDoc.Load(Server.MapPath("Path.rpt")):
CrystalDecisions.CrystalReports.Engine.Tables tblsReport = rptDoc.Database.Tables;
for(int i = 0; i < tblsReport.Count; i++)
{
CrystalDecisions.CrystalReports.Engine.Table tblRpt = tblsRpt[i];
TableLogOnInfo infoTable = tblRpt.LogOnInfo;
infoTable.ConnectionInfo = connCrystal;
tblRpt.ApplyLogOnInfo(infoTable);
}
if(rptDoc.SubReports.Count > 0)
{
for(int i = 0; i < rptDoc.SubReports.Count; i++)
{
ReportDocument subReport = rptDoc.OpenSubReport(rptDoc.Subreports[i].Name);
CrystalDecisions.CrystalReports.Engine.Tables tblsSubReport = subReport.Database.Tables;
for(int ii = 0; ii < tblsSubReport.Count; ii++)
{
CrystalDecisions.CrystalReports.Engine.Table tblSubRpt = tblsSubReport[ii];
TableLogOnInfo infoSubTable = tblsSubReport.LogOnInfo;
infoSubTable.ConnectionInfo = connCrystal;
tblsSubReport.ApplyLogOnInfo(infoSubTable);
}
}
Kind Regards