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

How prevent report from running on page load

37 Answers 1637 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff Berry
Top achievements
Rank 2
Jeff Berry asked on 26 Jan 2011, 05:51 AM
We're using the most recent release of Telerik Reporting.

I have a report that takes a long time to run.  On page load, I default the parameters for the users (most of the time they will use the defaults).

The problem is that, when they load the page (ASP.NET web viewer), and the parameters are filled in, the report runs automatically. 

This is a problem because they do not have the opportunity to change the parameters and have to wait a long time for that intial run. 

So, I do not want the report to run until they hit the Preview button on the web viewer.

Can someone please advise?

37 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 26 Jan 2011, 02:58 PM
Hi Jeff Berry,

This is how the ASP.NET viewer works in the current implementation whenever all report parameters have value and this behavior cannot be changed. If the user is to select a parameter prior running the report, do not set default values for the parameters.
If you prefer to have the most common used as default but want to avoid running the report, what you can do is implement your own UI for the report parameters that is wired to the Report API and this way the report would not be run until you press a "Preview/Run Report" button from your UI.

Best wishes,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
Jonathan
Top achievements
Rank 1
answered on 28 Dec 2011, 04:26 AM
Steve,

That is a pretty crappy answer, it seems like a pretty basic feature to just allow it not to auto run. I don't want to have to build my own parameter interface when yours does fairly well.
0
Steve
Telerik team
answered on 28 Dec 2011, 04:23 PM
Hi Jonathan,

The current implementation represents our understanding/view of how the report parameters should work and there is no technical limitation that prevents us from making it otherwise. We believe that it is straight-forward (more than anything else) when all parameters have default values, to let the report run automatically. If there is enough interest to halt the viewer and require user interaction, then we would certainly consider it.

Happy Holidays!

All the best,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Jonathan
Top achievements
Rank 1
answered on 28 Dec 2011, 05:09 PM
The issue is on reports that are larger we like to "recommend" values to our users. So say it is something as simple as a Start Date, End Date params. We generally may recommend month to date, last month, ect depending on the report. But would love to save the cycles of running the intensive report for something the user really doesn't want.  

I have built a dynamic parameter screen for your stuff before, it is just sad that I basically have to redo functionality that is in the control for something as simple as not letting it autorun. It should be as simple as AutoRun="false" and move on. No need to build a custom param screen.

At least you have a way around it, even though it I don't agree with your line of thought on the auto run. I would never let a user just take the defaults and run them. I would give them the opportunity to modify the params. 
0
skobyjay
Top achievements
Rank 1
answered on 13 Aug 2012, 03:50 AM
I'm experiencing the EXACT same issue as Jonathan.

I would agree with Jonathan, it does seems like a very simple request and from a programming stand point a very logical behavior.

In short, I couldn't agree more with Jonathan's statement below. I think that is a HUGE workaround for such simple functionality that we are needing..

"At least you have a way around it, even though it I don't agree with your line of thought on the auto run. I would never let a user just take the defaults and run them. I would give them the opportunity to modify the params. "
0
Chris T.
Top achievements
Rank 1
answered on 16 Aug 2012, 03:41 PM
"In short, I couldn't agree more with Jonathan's statement below. I think that is a HUGE workaround for such simple functionality that we are needing.."

Ditto.  We have the exact same situation.  Bleah.
0
David
Top achievements
Rank 1
answered on 05 Sep 2012, 06:30 AM
I am in full agreement with the other users on this thread.  Telerik needs to support this request.  You should allow the developer to decide what is best for their implementation of the report viewer control when it comes to auto running (regardless of the parameters default configuration). 

My big concern is that you said:
"The current implementation represents our understanding/view of how the report parameters should work and there is no technical limitation that prevents us from making it otherwise."

If there is no technical limitation in adding this functionality, then you should add it.  We (your customers) need this functionality because some reports are very process intensive and the user should be able to use the default values we suggest or modify them before the report runs.  Conversely, some users may like the auto run, so in that case you can support both sides.

This should be an EASY win for Telerik.  Please support this functionality.
0
Chavdar
Telerik team
answered on 05 Sep 2012, 03:24 PM
Hello guys,

Due to the popular demand for this feature we have prepared a workaround for those of you that want to try it. What you have to do is to place the following javascript code at the end of the form element or right after the report viewer's declaration which modified the default behavior of the method which displays the report:
<script type="text/javascript">
    ReportViewer.prototype.GenerateReport = ReportViewer.prototype.RefreshReportArea;
 
    ReportViewer.prototype.RefreshReportArea = function (refresh)
    {
        if (refresh)
        {
            this.GenerateReport(refresh);
        }
        else
        {
            this.DisplayError("<br /><br />Click Refresh or Preview button to generate the report.");
 
            this.EnableRefreshButton(true);
        }
    }
</script>

Have in mind that the Preview button is only available when there is at least one report parameter that has the AutoRefresh property set to false. You can also customize the sample message so that it best suits your case.

Give it a try and let us know whether we have correctly understood your query. Any feedback will be welcomed.

Greetings,
Chavdar
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Lily
Top achievements
Rank 1
answered on 16 Nov 2012, 06:27 PM
The solution is not working for me. This is the code of my page, where I should put the javascript code?:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ViewReport.aspx.cs" Inherits="InventoryTRSReportWeb.ViewReport" %>
 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=6.0.12.215, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
    Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <table width="100%">
         
    <tr>
    <td align="center">
    <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Large"></asp:Label>
    </td>
    </tr>
    <tr>
    <td>
    <telerik:ReportViewer ID="ReportViewer1" runat="server" Width="100%">
      
</telerik:ReportViewer>
<asp:Label ID="Label2" runat="server"></asp:Label>
    </td>
    </tr>
 
    </table>
    </form>
     
</body>
</html>
0
Steve
Telerik team
answered on 20 Nov 2012, 01:48 PM
Hi Lily,

This code should be placed after the report viewer declaration. The provided code snippet has been tested locally and verified it works.

All the best,
Steve
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Andreas Selling
Top achievements
Rank 2
answered on 16 Jan 2013, 01:38 PM
I can also say that this is a feature many of our users who uses the reports asks for.
0
Ubuntu
Top achievements
Rank 1
answered on 25 Apr 2013, 11:01 AM
Dear Steve,

    Is there an equivalent for silverlight ?


Best regards
0
Andre
Top achievements
Rank 1
answered on 15 Apr 2014, 04:00 PM
I agree with all the users here, this is a very simple feature to not be implemented.

My workaround was as simple as not only set the reportsource when the user clicks our button.
0
John
Top achievements
Rank 1
answered on 23 May 2014, 07:52 PM
And how do I do this in the HTML viewer?
0
Hinata
Top achievements
Rank 1
answered on 28 May 2014, 01:15 PM
Hi John,

The HTML5 report viewer widget is usually created within the following script element:
<script type="text/javascript">
        $("#reportViewer1")
            .telerik_ReportViewer({
                serviceUrl: "/api/reports/",
                templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate.htmll',
                reportSource: {
                    report: "Telerik.Reporting.Examples.CSharp.ProductCatalog, CSharp.ReportLibrary",
                    parameters: {
                        CultureID: "en"
                    }
                }
            });
</script>

Instead of just adding the widget, you can create a button on your page that adds the widget. You can do that by attaching an event handler function to the click event of the button.
0
Gabriel
Top achievements
Rank 1
answered on 20 Oct 2014, 10:08 AM
Hello,

is this functionality implemented now or is there a workaround to do it with Silverlight ?

Thanks
0
Hinata
Top achievements
Rank 1
answered on 23 Oct 2014, 09:03 AM
Hi Gabriel,

You can set the initial parameters to such values, which are not going to retrieve lots of data and make the user wait forever to view the report. Or just do not set default values for the parameters and the users will have to set their values.
0
John
Top achievements
Rank 1
answered on 23 Oct 2014, 01:52 PM
I just don't understand. Why should we have to execute the report as soon as it is rendered? It seems like a major use case to first wait for parameters to be set, then execute it. Why show an error message when not set, or force us to execute some unwanted query. Can we just change it to not auto execute and half a) a button or b) a method, to execute it?
0
Stef
Telerik team
answered on 28 Oct 2014, 08:05 AM
Hello John,

In order to display a report it is wrapped in a Report Source object. Thus the viewer and the report source are not aware of the underlying report's properties. The engine must try to resolve the report to find out if it requires parameters' values or has any other problem in it.

If you want to control when the report is rendered, you can use custom UI for the parameters area and pass the report and its settings to the viewer when the end-user decides.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Pietro
Top achievements
Rank 1
answered on 18 Mar 2015, 09:15 AM
Hi Stef,

is there an example/tutorial about pass the report and its settings to the viewer when the end-user decides?

Thanks

Pietro
0
Stef
Telerik team
answered on 20 Mar 2015, 04:00 PM
Hi Pietro,

If the scenario is to change the displayed report, please check the How To: Pass Values to Report Parameters article. By changing the viewer's reportSource from the client, the HTML5 viewer sends a request to the service to get the new report.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Pietro
Top achievements
Rank 1
answered on 20 Mar 2015, 04:36 PM
Hi Stef,
thanks for your advice,
now I can load reportviewer on user demand by loading a partial view through jquery ajax call.

If you have any other advice please share it.

Thanks.

Regards,
Pietro.
0
Stef
Telerik team
answered on 25 Mar 2015, 11:26 AM
Hi Pietro,

There is nothing to add. More details are available in the forum thread you opened on the same question.
If you have any issue, please feel free to open a support ticket or post the question in the public forum.

Regards,
Stef
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Scott
Top achievements
Rank 1
answered on 07 Aug 2015, 05:14 PM

I would just like to add my disappointment at Telerik for the lack of this most basic feature. 

This is like reporting 101.  4 years later and they STILL don't have this??

I have a report that takes quite a while to load, and 95% of the time the default parameters are not what the user wants.  So they have to sit and wait for it to load, THEN make the changes.  Absolutely unacceptable.

Telerik, get your crap together and listen to your users and implement this!

0
Stef
Telerik team
answered on 11 Aug 2015, 12:51 PM
Hi Scott,

Please test removing the report parameter's default values from the report definition. If the parameters are used in the data-retrieval, the report processing will be stopped due to missing parameters' values.

You can also use custom UI to provide values to report parameters, which will allow you to validate the user selection and run the report only when needed.


I will appreciate it if you elaborate on the scenario, the used viewer and the report's settings. This will help us understand better the case and provide you more accurate suggestions.

Regards,
Stef
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Diane
Top achievements
Rank 1
answered on 13 Apr 2016, 05:27 PM

I totally agree that this is a problem for long reports that take a while to load.

I think telerik should have a report STOP button on the top of the screen with all the other buttons you have.  Give the operator ability to cancel searching for the report so they can select other filters and then they can run it again on their own.

Nice red stop sign icon will do.

 

0
Stef
Telerik team
answered on 14 Apr 2016, 04:06 PM
Hi Diane,

The feature is supported only by the WinForms Reportviewer, where the thread in which the report is processed can be aborted. Please feel free to log a feature request to have similar functionality for other viewers - feedback portal.

I can suggest you also to test the following settings:
  1. Filter data on retrieval - Filtering data;
  2. Once all data is retrieved, check the number of records. On a trial-error basis you can determine what amount of data is suitable for further processing by the report.
    1. If records are too many, you throw an error, reduce the records or other action.
    2. If records are in reasonable amount, you can skip the custom logic for preventing their processing.

I hope this information is helpful.

Regards,
Stef
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Raymond
Top achievements
Rank 1
answered on 23 Mar 2017, 07:49 PM

Telerik is like Microsoft in this aspect. Even though it is probably a simple change for them to provide an option not to auto-run reports, they refuse to do this out of pure stubbornness or laziness.

I am forced to use the stand-alone report designer in a Silverlight application that I did not build and cannot change to make a custom interface. There should be an option to prevent the auto run.

 

0
Stef
Telerik team
answered on 24 Mar 2017, 04:32 PM
Hi Raymond,

The Silverlight ReportViewer is a client of the Reporting WCF Service which is hosted on the server machine. When you specify a report it is requested from the server and respectively the reporting engine tries to get the report rendered in XAML for the viewer. This includes processing the report and if there are missing parameters values an error will be returned to the client (viewer).

If you want to avoid the initial evaluation, you can use custom UI and specify the report after the user selected the desired filter values - ApplyParameters Event.

Regards,
Stef
Telerik by Progress
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 Feedback Portal and vote to affect the priority of the items
0
Martin
Top achievements
Rank 1
answered on 22 Jun 2017, 08:58 AM

I would just like to add my voice to this thread - this is a basic feature. Telerik is so great in many ways, and then something this basic completely lets it down.

For me - this could be the clincher in that I may have to abandon Telerik Reporting and use something else, which is a shame, because I'm generally impressed with it, but this makes it almost unusable in my use case. Please don't make me go back to Crystal, please, I beg you!

I would recommend people on this thread vote up this feature request here...
https://feedback.telerik.com/Project/162/Feedback/Details/196236-stop-auto-run-of-reports

In the meantime, I'm trying to find a workaround - none of the ones above (empty parameters etc.) work for me, and the custom parameter UI is not ideal in my situation. And I really hate Crystal, so I need to find one...! ;-)

0
Stef
Telerik team
answered on 22 Jun 2017, 12:22 PM
Hi Martin,

Thank you for this feedback.
Please vote for the logged feature request and include details about the cases where the functionality is required in comments.

The available workarounds are:
  1. Use custom UI to update the viewer's reportSource - How To: Pass Values to Report Parameters. You will need to make a request to the server to get information about the selected report's ReportParameters collection;
  2. Use default values for report parameters in the report which will be used initially. you can also use a value that has special meaning for the data retrieval method e.g. add a check for that special value in the WHERE clause of a select statement and return 0 records if it is detected;
  3. Use custom editors for report parameters in order to avoid having users who submit empty values or values invalid by requirement which will trigger the report processing - How To: Create a Custom Parameter Editor.


Regards,
Stef
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Martin
Top achievements
Rank 1
answered on 22 Jun 2017, 12:50 PM

Hi Stef - is it possible to detect the preview/refresh button click, or to alter its event?

What I'm thinking as an option (not ideal), is to add a boolean parameter, say @RunReport, and include it in the where clause of the report SQL (AND @RunReport = 'true'). This would appear as a on the parameter screen that the user has to tick before any records will be returned.

This obviously isn't but is a workaround for now.

I wondered if it was possible to have this as a hidden parameter, which you could set in the Preview/Refresh button's click event? So that on page load, it's and returns no data, but if you click the button, it sets it to true and data is returned?

 

0
Raymond
Top achievements
Rank 1
answered on 22 Jun 2017, 04:06 PM
Telerik is like Microsoft in their absolute refusal to add a feature that would take their engineers five minutes to add. It's just silly. I write reports for a vendor created web site. I cannot change the vendor's web site to create a custom UI.
0
Stef
Telerik team
answered on 23 Jun 2017, 01:54 PM
Hi,

 @Martin
: You can add the SQL parameter in the data-retrieval method and map it to a Boolean report parameter. Leave the report parameter visible, without default value and with AllowNull=false, AllowBlank=false, AutoRefresh=false. This will cause users to first check the parameter and then click the preview button to trigger the document generation.

Catching the Preview button's click event would require you to make changes in the viewer's JS template, and to upgrade the file manually each time:
//telerikReportViewer-x.x.x.x.js
//anout line 2840
  $previewButton.on("click", function(e) {
            e.preventDefault();
            if (allParametersValid()) {
                applyParameters();
            }
        });


@Raymond: The HTML5 viewer uses HTTP requests to get resources produced on the server machine. Also Reports are processed and rendered on the server machine, where the server polls for the status of the document generation on the server. The document generation starts at the moment the viewer manages to submits values for all report parameters, where it is important how report parameters are configured. If having a null or blank space is a valid value, the processing will be started and it can be terminated only on the server.
Report parameters can be configured to trigger the viewer's parameters validation and to not allow blank values or null as valid values.
The interpretation of parameters values should be done in the data retrieval method or where data is filtered, as it depends on custom requirements. On the other side, proper validation of parameters' values should be done correctly by the viewer based on the report's settings.
We will appreciate it if you elaborate on the settings of your report and the data-retrieval method in order to provide you further suggestions than using custom UI to update parameters and the displayed report.

Regards,
Stef
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Martin
Top achievements
Rank 1
answered on 26 Jun 2017, 02:05 PM

Hi Stef,

Thanks for the suggestion - obviously when I install reporting to a project I only have the .min file for the Report Viewer - where can I get the un-minimised version?

0
Stef
Telerik team
answered on 27 Jun 2017, 10:06 AM
Hi Martin,

The VS item templates for adding the HTML5 Viewer use the minimized version, but you can replace the link on the page with another modified file. Copies of all HTML5 Viewer's resources are installed by default in C:\Program Files (x86)\Telerik\Reporting <VERSION>\Html5\ReportViewer.

Regards,
Stef
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Martin
Top achievements
Rank 1
answered on 04 Jul 2017, 10:55 AM

OK - I think the quickest and easiest 'solution' to this, shall I say, major bug ;-), is to add a report parameter called 'Confirm Selection', which is a boolean that has to be ticked. I've shown the setup in a screenshot attached. AllowBlank and AllowNull should be false, and the parameter set to Visible.

This prevents the report from auto and allows all of your 'real' parameters to have default values.

It's not ideal, a little clunky, but it does the job.

Tags
General Discussions
Asked by
Jeff Berry
Top achievements
Rank 2
Answers by
Steve
Telerik team
Jonathan
Top achievements
Rank 1
skobyjay
Top achievements
Rank 1
Chris T.
Top achievements
Rank 1
David
Top achievements
Rank 1
Chavdar
Telerik team
Lily
Top achievements
Rank 1
Andreas Selling
Top achievements
Rank 2
Ubuntu
Top achievements
Rank 1
Andre
Top achievements
Rank 1
John
Top achievements
Rank 1
Hinata
Top achievements
Rank 1
Gabriel
Top achievements
Rank 1
Stef
Telerik team
Pietro
Top achievements
Rank 1
Scott
Top achievements
Rank 1
Diane
Top achievements
Rank 1
Raymond
Top achievements
Rank 1
Martin
Top achievements
Rank 1
Share this question
or