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

HTML5 ReportViewer autoload issue

19 Answers 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 23 May 2014, 08:12 PM
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>

19 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 23 May 2014, 08:15 PM
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.
0
Nasko
Telerik team
answered on 28 May 2014, 02:05 PM
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.

 
0
John
Top achievements
Rank 1
answered on 28 May 2014, 04:14 PM
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...
0
Nasko
Telerik team
answered on 31 May 2014, 06:33 AM
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.

 
0
Chris
Top achievements
Rank 1
answered on 22 Jul 2014, 09:04 PM
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.
0
Nasko
Telerik team
answered on 25 Jul 2014, 12:35 PM
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.

 
0
Tracy
Top achievements
Rank 1
answered on 05 Mar 2015, 03:07 PM
Wondered if this has been addressed in one of the newer versions? I am trying to avoid the same scenario.
0
John
Top achievements
Rank 1
answered on 05 Mar 2015, 03:10 PM
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'.
0
Tracy
Top achievements
Rank 1
answered on 05 Mar 2015, 03:31 PM
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.
0
Kasun
Top achievements
Rank 1
answered on 08 Nov 2016, 02:28 PM
Do we have a Preview Button in HTML5 report viewer? How do we execute the report after selecting all the parameters ?
0
Katia
Telerik team
answered on 08 Nov 2016, 02:49 PM
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 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
0
Kasun
Top achievements
Rank 1
answered on 08 Nov 2016, 02:58 PM

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 ? 

0
Katia
Telerik team
answered on 09 Nov 2016, 09:28 AM
Hello Kasun,

Check if the report parameters have 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
0
Kasun
Top achievements
Rank 1
answered on 09 Nov 2016, 01:26 PM

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. 

0
Shweta
Top achievements
Rank 1
answered on 18 Jan 2017, 09:55 AM

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?

 

0
Katia
Telerik team
answered on 18 Jan 2017, 11:00 AM
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
0
Shweta
Top achievements
Rank 1
answered on 18 Jan 2017, 11:39 AM

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>

0
Shweta
Top achievements
Rank 1
answered on 18 Jan 2017, 12:32 PM

Hi Katia,

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

Thanks

Shweta 

 

 

0
Katia
Telerik team
answered on 18 Jan 2017, 01:56 PM
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
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Nasko
Telerik team
Chris
Top achievements
Rank 1
Tracy
Top achievements
Rank 1
Kasun
Top achievements
Rank 1
Katia
Telerik team
Shweta
Top achievements
Rank 1
Share this question
or