Change Query Timeout Limit

13 posts, 1 answers
  1. bradley baker
    bradley baker avatar
    97 posts
    Member since:
    Aug 2009

    Posted 28 Dec 2009 Link to this post

    How do I change the query timout limit value in Telerik Reporting?

    In telerik grid I would set
    e.command.commandtimeout = 0

    is there a command like that for the reporting module also?
  2. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 04 Jan 2010 Link to this post

    Hello Bradley,

    Telerik Reporting does not provide its own data layer but depends on the existing .NET objects (DataSet, Data Table, DataView, ADO.NET, lists - for more information on report data binding, please, refer to this help topic). In this line of thoughts, it is up to the developer to prepare and provide the DataSource for the report. This holds true for altering the settings of the SqlCommand as well e.g.:

    private void Report1_NeedDataSource(object  sender, System.EventArgs e)
    {
       SqlCommand  sqlSelectCommand1 = new SqlCommand();
       sqlSelectCommand1.CommandTimeout = 40;
       SqlDataAdapter sqlDataAdapter1 = new SqlDataAdapter();
       SqlConnection sqlConnection1 = new SqlConnection();
       sqlConnection1.ConnectionString = "Data Source=(local)\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=True";
       sqlSelectCommand1.CommandText = "SELECT * FROM Production.Product";
       sqlSelectCommand1.Connection = sqlConnection1;
       sqlDataAdapter1.SelectCommand = sqlSelectCommand1;
       (sender as Telerik.Reporting.Processing.Report).DataSource = sqlDataAdapter1;
    }


    Regards,
    Steve
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Steve Johnson
    Steve Johnson avatar
    24 posts
    Member since:
    Feb 2010

    Posted 29 Apr 2010 Link to this post

    With the Q1 2010 release there doesn't seem to be an exposed SqlCommand anymore.  Is there any other way to set this value?  I can't be sure, but it looks like I'm running into a problem with this.  Many of my reports are timing out after 30 seconds (the default), and I've set every other timeout value I can think of to 600 seconds or greater.

    Thanks,
    Steve
  5. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 30 Apr 2010 Link to this post

    Hi Steve Johnson,

    With Q1 2010 we have introduced a SqlDataSource Component. The example that my colleague sent you is about the SqlCommand. Do you want to set the timeout to the SqlDataSource? If this is the case you can modify the ConnectionString from the project's Settings or delete the old one and create a new one with a custom Timeout. Check out the following screenshoot:



    Regards,
    Peter
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Steve Johnson
    Steve Johnson avatar
    24 posts
    Member since:
    Feb 2010

    Posted 30 Apr 2010 Link to this post

    You are talking about the Connect Timeout which can be set in the Connection String.

    What is at issue here is the CommandTimeout which is set as a property of an individual .NET SqlCommand object.  In an effort to solve the problem of my reports timing out after 30 seconds, I set the Connect Timeout in my Connection Strings to 600 seconds (10  min), and also provided implemented the IReportServiceClientFactory with the following code
            public ReportServiceClient Create(Uri remoteAddress)  
            {  
                BasicHttpBinding binding = new BasicHttpBinding();  
     
                //     
                // Increase the max message size in order to avoid the dreaded message:     
                // System.ServiceModel.CommunicationException : The maximum message size quota for incoming     
                // messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize      
                // property on the appropriate binding element.     
                //     
                binding.MaxReceivedMessageSize = Int32.MaxValue;  
     
     
                //     
                // Now set the timeout to an appropriate number of seconds.     
                // TODO:  Handle the timeout exception gracefully if it does happen, i.e., set the timeout to 5 seconds.     
                //     
                binding.SendTimeout = new System.TimeSpan(0, 0, 600);  
                binding.ReceiveTimeout = new System.TimeSpan(0, 0, 600);  
     
     
                return new ReportServiceClient(binding, new EndpointAddress(remoteAddress));  
            }  
     
    .
    Neither of these have provided a solution.

    Now I'm only guessing, but it appears the only timeout left which is set to 30 seconds by default is the SqlCommand.CommandTimeout. Many of my reports are timing out exactly at 30 seconds, and without the ability to set this value I cannot determine without a doubt that this is the problem.  I assume that at some point in the ReportService code there is a SqlCommand object being created, or some similar object that contains this CommandTimeout property that can be set.  If I am correct, and this is the valuie that I must change in order for my reports to run, the inability to change the value will render Telerik Reporting useless for our development needs.  We are developing an application for the State of Nevada where we deal in database tables that have in excess of 1,000,000 records.  I really have no desire to switch reporting products, and it will seriously affect our development schedule if we are forced to, however if I cannot resolve this issue quickly, I will have no choice.

    Please do all you can to provide a way to set this value, or help me find the true cause of this timeout.

    Thank you,
    Steve
  7. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 03 May 2010 Link to this post

    Hi Steve Johnson,

    While the SqlDataSource still lacks a way to configure the timeout for the select command you can still use the SqlDataAdapter as described previously in this thread.

    Anyway we are about to provide a way to set a timeout for the SqlDataSource component so it should be available soon.

     
    All the best,
    Svetoslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Steve Johnson
    Steve Johnson avatar
    24 posts
    Member since:
    Feb 2010

    Posted 03 May 2010 Link to this post

    It appears that if I revert back to the SqlDataAdapter I will use the ability ti apply report parameters to the SQL Statement; is this true?  If so, I don't think the SqlDataAdapter would be a viable solution. 

    I appreciate hearing that the SqlDataSource will provide a solution in the future.  Is there a known timeframe that I can share with my superiors?

    Thanks again,
    Steve
  9. Milen
    Admin
    Milen avatar
    163 posts

    Posted 07 May 2010 Link to this post

    Hi Steve,

    We will try to include the requested settings in the following internal releases, but cannot point exact time frame.

    However you do have the ability to use parameterized query/SP in Telerik Reporting without using the new SqlDataSource. The idea is to manually transfer the values of the report parameters to the SQL parameters in the NeedDataSource event.

    For detailed steps please refer to the KB article Using data source with parameters in Telerik Reporting.

    Kind regards,
    Milen
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. ndugwa2u
    ndugwa2u avatar
    3 posts
    Member since:
    Mar 2010

    Posted 10 Dec 2012 Link to this post

    It works
  11. Gaurav
    Gaurav avatar
    35 posts
    Member since:
    Nov 2012

    Posted 11 Oct 2013 Link to this post

    What if i am using report created by standalone s/w and using report viewer in silverlight ?
  12. Madona
    Madona avatar
    2 posts
    Member since:
    Oct 2013

    Posted 18 Feb 2015 in reply to Peter Link to this post

    Hello, I
    use telerik to generate report to my Silverlight app. I my report query return
    6550 records, and telerik seem to be unable to support this amount of data as
    result I have a timeout exception as you can see on image as attach (timeout.png).

    The connection
    string of my report has some configurations at web.config, in that manner:

      <add name="SL_Relatorios.Properties.Settings.CmamConnectionString" connectionString="Data Source=localhost;Initial
    Catalog=FCF;User ID=###;Password=###; providerName="System.Data.SqlClient" />

     

    I tried to
    define a new connection timeout and a max pool size:

     

      <add name="SL_Relatorios.Properties.Settings.CmamConnectionString" connectionString="Data Source=localhost;Initial
    Catalog=FCF;User ID=###;Password=###; Connection Timeout=10000" pooling='true'; Max Pool Size=8000; providerName="System.Data.SqlClient"
    />

     

    I also tried to define a new command timeout at my report as you can see at the image telerik prop.png

    But none of them work, what can I do to avoid the timeout?

     

    Hope your
    feedback .

     

     

     

     

     
  13. KS
    KS avatar
    5 posts
    Member since:
    Dec 2012

    Posted 18 Feb 2015 in reply to Madona Link to this post

    Hi,

    The error states the service timeout is not enough. Check this - http://www.telerik.com/help/reporting/wcf-report-service-increasing-timeout.html

    -KS
  14. Graham
    Graham avatar
    15 posts
    Member since:
    Jul 2012

    Posted 14 Nov in reply to bradley baker Link to this post

    In MVC, the timeout can be set in the designer.cs file. After the line...

     

    this.MyReport.ConnectionString =

     

    ...you can add the line...

     

    this.MyReport.CommandTimeout = 120;

Back to Top
DevCraft banner