This is a migrated thread and some comments may be shown as answers.

Change Query Timeout Limit

12 Answers 2309 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
bradley baker
Top achievements
Rank 1
bradley baker asked on 28 Dec 2009, 10:52 PM
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?

12 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 04 Jan 2010, 11:45 AM
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.
0
Steve Johnson
Top achievements
Rank 1
answered on 30 Apr 2010, 01:53 AM
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
0
Peter
Telerik team
answered on 30 Apr 2010, 06:09 PM
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.
0
Steve Johnson
Top achievements
Rank 1
answered on 30 Apr 2010, 07:17 PM
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
0
Svetoslav
Telerik team
answered on 03 May 2010, 04:41 PM
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.
0
Steve Johnson
Top achievements
Rank 1
answered on 03 May 2010, 05:09 PM
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
0
Milen | Product Manager @DX
Telerik team
answered on 07 May 2010, 09:14 AM
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.
0
ndugwa2u
Top achievements
Rank 1
answered on 10 Dec 2012, 06:48 PM
It works
Mariano
Top achievements
Rank 1
commented on 03 Sep 2023, 10:37 PM

Hi 

Could you help me telling me how do you made it works, Am experiencing the same problem, all reports close with 30 seconds timeout
Kind regards
0
Gaurav
Top achievements
Rank 1
answered on 11 Oct 2013, 09:06 AM
What if i am using report created by standalone s/w and using report viewer in silverlight ?
0
Madona
Top achievements
Rank 1
answered on 18 Feb 2015, 12:49 PM
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 .

 

 

 

 

 
0
KS
Top achievements
Rank 1
answered on 18 Feb 2015, 04:51 PM
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
0
Graham
Top achievements
Rank 2
Iron
Iron
answered on 14 Nov 2016, 04:13 PM

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;

Tags
General Discussions
Asked by
bradley baker
Top achievements
Rank 1
Answers by
Steve
Telerik team
Steve Johnson
Top achievements
Rank 1
Peter
Telerik team
Svetoslav
Telerik team
Milen | Product Manager @DX
Telerik team
ndugwa2u
Top achievements
Rank 1
Gaurav
Top achievements
Rank 1
Madona
Top achievements
Rank 1
KS
Top achievements
Rank 1
Graham
Top achievements
Rank 2
Iron
Iron
Share this question
or