How prevent report from running on page load

28 posts, 0 answers
  1. Jeff Berry
    Jeff Berry avatar
    13 posts
    Member since:
    Jun 2009

    Posted 25 Jan 2011 Link to this post

    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?
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 26 Jan 2011 Link to this post

    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.
  3. DevCraft banner
  4. Jonathan
    Jonathan avatar
    57 posts
    Member since:
    Jun 2012

    Posted 27 Dec 2011 Link to this post

    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.
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 28 Dec 2011 Link to this post

    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!

  6. Jonathan
    Jonathan avatar
    57 posts
    Member since:
    Jun 2012

    Posted 28 Dec 2011 Link to this post

    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. 
  7. skobyjay
    skobyjay avatar
    15 posts
    Member since:
    Jul 2010

    Posted 12 Aug 2012 Link to this post

    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. "
  8. Chris T.
    Chris T. avatar
    26 posts
    Member since:
    Apr 2008

    Posted 16 Aug 2012 Link to this post

    "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.
  9. David
    David avatar
    6 posts
    Member since:
    Mar 2012

    Posted 05 Sep 2012 Link to this post

    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.
  10. Chavdar
    Admin
    Chavdar avatar
    898 posts

    Posted 05 Sep 2012 Link to this post

    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 >

  11. Lily
    Lily avatar
    4 posts
    Member since:
    Oct 2012

    Posted 16 Nov 2012 Link to this post

    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>
  12. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 20 Nov 2012 Link to this post

    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!

  13. Andreas Selling
    Andreas Selling avatar
    20 posts
    Member since:
    May 2009

    Posted 16 Jan 2013 Link to this post

    I can also say that this is a feature many of our users who uses the reports asks for.
  14. Ubuntu
    Ubuntu avatar
    89 posts
    Member since:
    Jul 2012

    Posted 25 Apr 2013 Link to this post

    Dear Steve,

        Is there an equivalent for silverlight ?


    Best regards
  15. Andre
    Andre avatar
    1 posts
    Member since:
    Mar 2013

    Posted 15 Apr 2014 in reply to Steve Link to this post

    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.
  16. John
    John avatar
    41 posts
    Member since:
    Jun 2013

    Posted 23 May 2014 in reply to Steve Link to this post

    And how do I do this in the HTML viewer?
  17. Hinata
    Hinata avatar
    146 posts
    Member since:
    Dec 2013

    Posted 28 May 2014 in reply to John Link to this post

    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.
  18. Gabriel
    Gabriel avatar
    1 posts
    Member since:
    Oct 2014

    Posted 20 Oct 2014 Link to this post

    Hello,

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

    Thanks
  19. Hinata
    Hinata avatar
    146 posts
    Member since:
    Dec 2013

    Posted 23 Oct 2014 in reply to Gabriel Link to this post

    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.
  20. John
    John avatar
    41 posts
    Member since:
    Jun 2013

    Posted 23 Oct 2014 in reply to Hinata Link to this post

    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?
  21. Stef
    Admin
    Stef avatar
    3042 posts

    Posted 28 Oct 2014 Link to this post

    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.

     
  22. Pietro
    Pietro avatar
    3 posts
    Member since:
    Jul 2010

    Posted 18 Mar 2015 in reply to Stef Link to this post

    Hi Stef,

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

    Thanks

    Pietro
  23. Stef
    Admin
    Stef avatar
    3042 posts

    Posted 20 Mar 2015 Link to this post

    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.

     
  24. Pietro
    Pietro avatar
    3 posts
    Member since:
    Jul 2010

    Posted 20 Mar 2015 in reply to Stef Link to this post

    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.
  25. Stef
    Admin
    Stef avatar
    3042 posts

    Posted 25 Mar 2015 Link to this post

    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.

     
  26. Scott
    Scott avatar
    2 posts
    Member since:
    Mar 2014

    Posted 07 Aug 2015 Link to this post

    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!

  27. Stef
    Admin
    Stef avatar
    3042 posts

    Posted 11 Aug 2015 Link to this post

    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
  28. Diane
    Diane avatar
    1 posts
    Member since:
    Jul 2013

    Posted 13 Apr Link to this post

    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.

     

  29. Stef
    Admin
    Stef avatar
    3042 posts

    Posted 14 Apr Link to this post

    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
Back to Top
DevCraft banner