HTML5 ReportViewer autoload issue

20 posts, 0 answers
  1. John
    John avatar
    41 posts
    Member since:
    Jun 2013

    Posted 23 May 2014 Link to this post

    I have a report where one parameter is to choose a user id (from a list, returned by a stored proc)
    There is no default value, and you MUST select a user id before running the report.
    For some reason, even though there is no default value and the user hasn't chosen an item, when the page loads, the report renders, without the needed parameter being supplied, which causes a missing parameter exception.

    Can I 

    a) Prevent the autoload altogether?
    b) If not, is it a bug that is autorenders when a parameter hasnt been supplied?

        <ReportParameter Name="UserID" Type="Integer" Visible="True" AllowBlank="False">
          <AvailableValues DataSourceName="sqlDataSource2" DisplayMember="=Fields.Name" ValueMember="= Fields.ID" />
          <Value>
            <String></String>
          </Value>
        </ReportParameter>
  2. John
    John avatar
    41 posts
    Member since:
    Jun 2013

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

    The error is 400 (Missing or invalid parameter value. Please input valid data for all parameters.).
    Setting AllowNull="False" in the markup doesnt help either.
  3. Nasko
    Admin
    Nasko avatar
    921 posts

    Posted 28 May 2014 Link to this post

    Hello John,

    We have tested the described scenario on our end. When the report parameter is required (AllowNull = False, AllowBlank = False, and no default value) the report is not rendered in the viewer. Instead the following error message is displayed: error message.
    Currently, this is the default behavior of the HTML5 Report Viewer. We have plans to make the error message more user friendly in a future version of the Reporting suite.

    In the meantime you can manually handle the scenario when the report parameter is not supplied with a value. Set the AllowBlank/AllowNull property to True and then if the parameter is blank/null, suppress some of the sections in the report and provide an appropriate error message via a text box in the report header section.

    Regards,
    Nasko
    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.

     
  4. John
    John avatar
    41 posts
    Member since:
    Jun 2013

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

    The problem is that the reportviewer attempts to run the report, even though it knows that it doesn't have all the required parameters. And of course that fails. And shows an error message.
    Instead, the report viewer should wait until the user presses the Preview button, after choosing all parameters.
    It makes no sense to call and show an error when you already know it is going to fail. Just let the user choose the parameters first...
  5. Nasko
    Admin
    Nasko avatar
    921 posts

    Posted 31 May 2014 Link to this post

    Hello John,

    Thank you for the provided feedback. We will further look into the issue with the report parameters validation and see if we can implement a different behavior, such as the one you suggested.
    We have logged this behavior in our system for improvement and it will be addressed for a future version of the Reporting suite.

    Regards,
    Nasko
    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.

     
  6. Chris
    Chris avatar
    1 posts
    Member since:
    Aug 2013

    Posted 22 Jul 2014 Link to this post

    I agree with John. You should be able to call up a blank viewer page asking for the required parameters before the report is rendered. Then the report should render once the user enters their parameters.
  7. Nasko
    Admin
    Nasko avatar
    921 posts

    Posted 25 Jul 2014 Link to this post

    Hello Chris,

    Thank you for your feedback. You have a point and we agree that the current behavior should be reworked. This issue has been logged in our system and it will be addressed in a future version of Telerik Reporting.

    Regards,
    Nasko
    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.

     
  8. Tracy
    Tracy avatar
    13 posts
    Member since:
    Nov 2010

    Posted 05 Mar 2015 in reply to Nasko Link to this post

    Wondered if this has been addressed in one of the newer versions? I am trying to avoid the same scenario.
  9. John
    John avatar
    41 posts
    Member since:
    Jun 2013

    Posted 05 Mar 2015 in reply to Tracy Link to this post

    To my knowledge it hasn't improved and we had to go the route of creating our own HTML5 report viewer to get it to work 'correctly'.
  10. Tracy
    Tracy avatar
    13 posts
    Member since:
    Nov 2010

    Posted 05 Mar 2015 in reply to John Link to this post

    Thanks for the quick reply...in my case my second parameter is data driven based on the first. So while i could default it, if the data changes i get the error anyway when it runs. Would be much better if i could disable the autoload feature. Not an option at this time to create our own viewer - no capacity.

    Telerik - i would add a request for this feature along with the other requests I've seen on this site for this, which appear to date back to 2011 based on another post I found.
  11. Kasun
    Kasun avatar
    16 posts
    Member since:
    Oct 2016

    Posted 08 Nov 2016 Link to this post

    Do we have a Preview Button in HTML5 report viewer? How do we execute the report after selecting all the parameters ?
  12. Katia
    Admin
    Katia avatar
    493 posts

    Posted 08 Nov 2016 Link to this post

    Hello Kasun,

    Preview button in the viewer's parameters area appears when at least one visible report parameter has AutoRefresh property set to false.
    In this case to preview the report, the end user should click the Preview button. If all parameters have default values, the report runs automatically on first view.

    More detailed information can be found in HTML5 Report Viewer help article.


    Regards,
    Katia
    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
  13. Kasun
    Kasun avatar
    16 posts
    Member since:
    Oct 2016

    Posted 08 Nov 2016 in reply to Katia Link to this post

    Hi Katia, 

    Thanks for the replay. I have 4 parameters and all of them have AutoRefresh property set to false in the designer . But still im not getting the preview button in the Parameters area. 

    I only have refresh button which refreshes the full report and remove all the parameter sections.

    Could you please help me with this? Is there any other settings we need change ? 

  14. Katia
    Admin
    Katia avatar
    493 posts

    Posted 09 Nov 2016 Link to this post

    Hello Kasun,

    Check if the report parameters have Visible property set to True.

    Another possible reason for not seeing the Preview button is custom CSS applied to the viewer. You can check using browser's console if there any custom styles applied to the viewer and disable them if needed.

    If the issue persists, you can attach a demo project reproducing it in a support ticket so we can test it locally.


    Regards,
    Katia
    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
  15. Kasun
    Kasun avatar
    16 posts
    Member since:
    Oct 2016

    Posted 09 Nov 2016 in reply to Katia Link to this post

    Hi Katia, 

    Thank for the reply. Forgive me that was one of my mistakes. There were some custom css applied to the viewer. We fixed it and now the Preview button is visible. 

  16. Shweta
    Shweta avatar
    6 posts
    Member since:
    Mar 2016

    Posted 18 Jan Link to this post

    Hi,

    Is there any solution yet for stopping auto rendering of Html5 report. Report should not render until Preview clicked. Is there any way to achieve this?

     

  17. Katia
    Admin
    Katia avatar
    493 posts

    Posted 18 Jan Link to this post

    Hello Shweta,

    Test setting AutoRefresh property to False for all report parameters. If no default value is set as parameter's Value property and AllowNull/AllowBlank are also set to False the notification appears in the report preview area prompting the user to enter the valid values for the report parameters.

    For more detailed information about parameter's settings, you can check this help article.


    Regards,
    Katia
    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
  18. Shweta
    Shweta avatar
    6 posts
    Member since:
    Mar 2016

    Posted 18 Jan in reply to Katia Link to this post

    My problem is i have to set default parameters but don't want report to render automatically until Preview clicked. I can't make AutoRefresh false and don't want to have error also, just want to stop auto rendering. In earlier telerik version we added below code to stop auto rendering which is not working with Html5 version. Please provide a solution for same, its really important

    <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>

  19. Shweta
    Shweta avatar
    6 posts
    Member since:
    Mar 2016

    Posted 18 Jan in reply to Shweta Link to this post

    Hi Katia,

    Please respond to my post. It is really important to knwo whethere this is possible or not.

    Thanks

    Shweta 

     

     

  20. Katia
    Admin
    Katia avatar
    493 posts

    Posted 18 Jan Link to this post

    Hello Shweta,

    Such behavior is not supported, the report will always execute when it is shown in the viewer and valid values for the report parameters are set as their Value properties.

    To stop the report from rendering you need to reset the parameters' Value properties and set AutoRefresh, AllowNull(AllowBlank) properties to false.

    A workaround can be to add a hidden report parameter with no default value and to use the custom UI for the parameter's area to pass the value for the hidden parameter when the custom Preview button is clicked - How To: Pass Values to Report Parameters.


    Regards,
    Katia
    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
Back to Top