本文介绍了与水晶报告有关的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 大家好 我安装了一个在Windows应用程序.NET和sql server 2005中开发的项目。我使用了Crystal报告。问题与水晶报告有关.Report在第一次登录再次出现它显示像加载报告失败。如果我们关闭并重新启动应用程序它第一次工作正常。我使用odbc连接技术为什么发生这样?这个问题的任何解决方案。我也粘贴我的代码 引用: objRep.cry_rp1.ReportSource = Application.StartupPath + @ \\ _Reports\Crt_Purchase_Order.rpt; objRep.cry_rp1.SelectionFormula ={OT_PURCHASE_ORDER.PO_Tran_Code} ='+ txtrancode.Text +/+ txtdocno.Text +'; Quote: private void ConfigureCrystalReports() { string Crystaluser = Convert.ToString(System.Co nfiguration.ConfigurationSettings.AppSettings [Crystaluser]); string CrystalPasword = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings [CrystalPassword]); string CrystalDatasource = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings [CrystalDatasource]); string CrystalHostname = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings [CrystalHostname]); ConnectionInfo connectionInfo = new ConnectionInfo(); connectionInfo.ServerName = CrystalHostname; connectionInfo.DatabaseName = CrystalDatasource; connectionInfo.UserID = Crystaluser; connectionInfo.Password = CrystalPasword; connectionInfo.IntegratedSecurity = false; SetDBLogonForReport(connectionInfo); } pri vate void SetDBLogonForReport(ConnectionInfo connectionInfo) { TableLogOnInfos tableLogOnInfos = cry_rp1.LogOnInfo; foreach(tableLogOnInfos中的TableLogOnInfo tableLogOnInfo) { tableLogOnInfo.ConnectionInfo = connectionInfo; } } 在此先感谢 Amrutha 解决方案 amritha444写道:报告在第一次登录后再次显示,如加载报告失败。 Crystal Reports:修复加载报告失败错误。 [ ^ ] Hi AllI installed a project developed in windows application .NET and sql server 2005.I used Crystal report .The problem is related with crystal report.Report coming well in first login again its showing like load report failed.if we close and restart application it works fine for first time.I use odbc connection technique for this.why happening so ?Any solution for this problem.Iam pasting my code tooQuote: objRep.cry_rp1.ReportSource = Application.StartupPath + @"\Reports\Crt_Purchase_Order.rpt"; objRep.cry_rp1.SelectionFormula = "{OT_PURCHASE_ORDER.PO_Tran_Code} = '" + txtrancode.Text+"/"+txtdocno.Text + "' ";Quote: private void ConfigureCrystalReports() { string Crystaluser = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["Crystaluser"]); string CrystalPasword = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["CrystalPassword"]); string CrystalDatasource = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["CrystalDatasource"]); string CrystalHostname = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["CrystalHostname"]); ConnectionInfo connectionInfo = new ConnectionInfo(); connectionInfo.ServerName = CrystalHostname; connectionInfo.DatabaseName = CrystalDatasource; connectionInfo.UserID = Crystaluser; connectionInfo.Password = CrystalPasword; connectionInfo.IntegratedSecurity = false; SetDBLogonForReport(connectionInfo); } private void SetDBLogonForReport(ConnectionInfo connectionInfo) { TableLogOnInfos tableLogOnInfos = cry_rp1.LogOnInfo; foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos) { tableLogOnInfo.ConnectionInfo = connectionInfo; } }Thanks in AdvanceAmrutha 解决方案 amritha444 wrote:Report coming well in first login again its showing like load report failed.Crystal Reports: Fix for "Load report failed" error.[^] 这篇关于与水晶报告有关的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-15 17:22