Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

RE: How to set connection tmeout propery to crystal report using C#.net dynamically

$
0
0

Hi dear friends,

  Is that possible to set the connection timeout property for crystal repor, if the crystal report takes too longer than expected then i need to show a timeout error, right now some reports taking more than 10 -12 minutes to execute even though the stored proc is executed in less than a minute, since there is lot a data and to create paging in crystal report it is taking time. How can i inculude timeout in crystal ConnectionInfo

The below is the connection for the crystal report, its having all the connection info properties but no Connection Time out, how can i include connection time to the below code:

CrystalDecisions.Shared.TableLogOnInfo tliCurrent;

 foreach (CrystalDecisions.CrystalReports.Engine.Table tbl in
                crDoc.Database.Tables)
            {

               tbl.LogOnInfo.ConnectionInfo.IntegratedSecurity = false;

                tliCurrent = tbl.LogOnInfo;
                tliCurrent.ConnectionInfo.AllowCustomConnection = true;
                tliCurrent.ConnectionInfo.IntegratedSecurity = false;
                tliCurrent.ConnectionInfo.ServerName = "servername";
                tliCurrent.ConnectionInfo.UserID = "sa";
                tliCurrent.ConnectionInfo.Password = "password";
                tliCurrent.ConnectionInfo.DatabaseName = "dbname";
                //tliCurrent.ConnectionInfo.LogonProperties.Add(new NameValuePair2("Connection Timeout", 1)); // THIS IS NOT WORKING
                 tliCurrent.TableName = tbl.Name;
                 tbl.ApplyLogOnInfo(tliCurrent);

      }


Viewing all articles
Browse latest Browse all 1507

Trending Articles