Disable Report Viewer

I have an Ignition window with multiple Report Viewer components. The window includes some Radio Button components to allow the user to select which report to view. The Visible property of the Report Viewers is bound to the Selected property of the appropriate Radio Button. I have other components on the window that are used to set the parameter values for the reports.

The problem is that when one of the components that sets a parameter value changes, all the reports with parameters bound to that component (even those that are not Visible) reload and the “Loading…” status indicator is displayed during that time. It takes a while for all the reports to reload leading to a poor user experience. Is there a way to disable Report Viewers to prevent the report queries from running?

1 Like

Not sure what version you are running, I’m on 7.9.3 and the following worked for me.

You would need to break your bindings, and then in the scripting for the radio button set the properties and run the appropriate report accordingly.

rv = event.source.parent.getComponent('Report Viewer')
	
rv.setPropertyValueQuiet('Parameter Name',newParameterValue)
rv.loadReport()
1 Like

You may also consider tying the Report Path property of one viewer to the radio buttons. Something like:

SWITCH({Radio Button 1.selected},
       {Radio Button 2.selected},
       {Radio Button 3.selected},
       {Radio Button 4.selected},
       {Radio Button 5.selected},
       'Report1',
       'Report2',
       'Report3',
       'Report4',
       'Report5',
       'DefaultReport'
      )
       

EDIT: Sorry, I should put more explanation… my ADHS is showing (ADHS = Attention Defi-- Hey! Squirrel! ): That way you only have one viewer to contend with. Granted, I have no clue what your layout is like, I’m just spit-ballin’ an idea.

2 Likes

Thank you for the response. That looks like an interesting approach, I hope to find time soon to try it out.

Thank you for the suggestion. I thought about trying something like that but not all of my reports have the same parameters. Changing the Report Path at runtime causes the Report Viewer’s properties in the Report Parameters section to change and they seem to lose their bindings - the binding still seems to be configured but the value is not being passed to the report.

Yeah, I’m seeing that. It’s going to the Default Value in the report setup instead of using the binding in the viewer.

That rather stinks.

It does beg the question of whether we can force the refresh of a binding.

system.db.refresh(<component>, "<property>") will refresh any binding, not just DB related ones (as the name seems to imply)

1 Like