HTML5 ReportViewer autoload issue

15 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. DevCraft banner
  4. Nasko
    Admin
    Nasko avatar
    909 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.

     
  5. 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...
  6. Nasko
    Admin
    Nasko avatar
    909 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.

     
  7. 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.
  8. Nasko
    Admin
    Nasko avatar
    909 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.

     
  9. 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.
  10. 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'.
  11. 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.
  12. Kasun
    Kasun avatar
    16 posts
    Member since:
    Oct 2016

    Posted 08 Nov 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 ?
  13. Katia
    Admin
    Katia avatar
    301 posts

    Posted 08 Nov 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
  14. Kasun
    Kasun avatar
    16 posts
    Member since:
    Oct 2016

    Posted 08 Nov 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 ? 

  15. Katia
    Admin
    Katia avatar
    301 posts

    Posted 09 Nov 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
  16. Kasun
    Kasun avatar
    16 posts
    Member since:
    Oct 2016

    Posted 09 Nov 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. 

Back to Top
DevCraft banner