Topic: Loading report failed in ASP.NET with CR Server XI Posted: 08 Apr 2008 at 7:53am
Hi, I have a problem with loading .rpt in my ASP.NET application. I'm using .Crystal Reports Server XI as my report repository. My development machine is using Windows XP SP2 and the production server is using Windows Server 2003. My application works fine in development machine but I got "Database logon failed" message in production server. I have set database login & access rights, web.config and data source location in my .rpt to match the target machine so I don't how this can be happened. I have tried using Windows authentication too but it didn't work
Here is my code:
// InfoStoreConnectionHelper is a custom class to handle connection with Infostore // the report id is passed from another page ReportApplicationServer.InfoStoreConnectionHelper helper = new ReportApplicationServer.InfoStoreConnectionHelper(); using (helper) { //get client document by reportId CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument doc = helper.GetClientDocumentByID(id); if (doc != null) { CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag props = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBagClass(); CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos info = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos(); CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo ci = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfoClass(); props.Add("Data Source", ConfigurationManager.AppSettings["report_servername"]); props.Add("Initial Catalog", ConfigurationManager.AppSettings["report_dbname"]); ci.Attributes = props; ci.UserName = ConfigurationManager.AppSettings["report_username"]; ci.Password = ConfigurationManager.AppSettings["report_password"]; info.Add(ci);
CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag pb = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBagClass(); CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag lpb = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBagClass(); lpb.Add("Data Source", ConfigurationManager.AppSettings["report_servername"]); lpb.Add("Initial Catalog", ConfigurationManager.AppSettings["report_dbname"]); lpb.Add("Provider", "SQLOLEDB");
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum