Torna al Thread

DataSet dsOrdine = OrdineCorrente.GetdsOrdine(); String ServerName = ConfigurationManager.AppSettings["CrystalServerName"].ToString(); String UserID = ConfigurationManager.AppSettings["CrystalUserID"].ToString(); String Password = ConfigurationManager.AppSettings["CrystalPassword"].ToString(); String DatabaseNameReport = ConfigurationManager.AppSettings["CrystalDatabaseNameOMB"].ToString(); String DatabaseNameSubReport = ConfigurationManager.AppSettings["CrystalDatabaseNameDNN"].ToString(); TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); TableLogOnInfo crtableLogoninfo = new TableLogOnInfo(); ConnectionInfo crConnectionInfo = new ConnectionInfo(); Tables CrTables; Sections crSections; ReportObjects crReportObjects; SubreportObject crSubreportObject; ReportDocument subRepDoc = new ReportDocument(); Database crDatabase; ReportDocument crReportDocument = new ReportDocument(); crReportDocument.Load(Server.MapPath("RPT/Ordini.rpt")); crConnectionInfo.ServerName = ServerName; crConnectionInfo.UserID = UserID; crConnectionInfo.Password = Password; crConnectionInfo.DatabaseName = DatabaseNameReport; //modifica la connessione delle tabelle - stored - dataset - ...... CrTables = crReportDocument.Database.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables) { crtableLogoninfo = CrTable.LogOnInfo; crtableLogoninfo.ConnectionInfo = crConnectionInfo; CrTable.ApplyLogOnInfo(crtableLogoninfo); CrTable.Location = CrTable.Location.Substring(CrTable.Location.LastIndexOf(".") + 1); } crReportDocument.SetDataSource(dsOrdine); CrystalReportViewer1.ReportSource = crReportDocument;
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5