private void SetLogon(ReportDocument rptDocumentObject, string strReportPathtoLoad) { TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); TableLogOnInfo crtableLogoninfo = new TableLogOnInfo(); ConnectionInfo crConnectionInfo = new ConnectionInfo(); Tables CrTables; rptDocumentObject.Load(strReportPathtoLoad); crConnectionInfo.ServerName = ConnectionModule.IP; // giving Servername crConnectionInfo.DatabaseName = ConnectionModule.DBName; //Giving Databasename crConnectionInfo.UserID = ConnectionModule.Uid; //Giving Login ID crConnectionInfo.Password = ConnectionModule.Pwd; //Giving Password CrTables = rptDocumentObject.Database.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables) { crtableLogoninfo = CrTable.LogOnInfo; crtableLogoninfo.ConnectionInfo = crConnectionInfo; CrTable.ApplyLogOnInfo(crtableLogoninfo); } }
Page_Load()
Page_Init()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)