Udostępnij za pośrednictwem


Configuring ReportViewer for Asynchronous Rendering

To configure the ReportViewer Web server control for asynchronous rendering, you must set the rendering and processing modes. The rendering behavior is specified by the AsyncRendering property on the control and the processing behavior is specified by the ProcessingMode property. The combination of these two properties defines how your ASP.NET pages will render.

The following table describes the behavior of the ReportViewer control for the different rendering and processing modes.

Property Setting Local Processing Mode (LocalReport class) Remote Processing Mode (ServerReport class)

AsyncRendering = True

  • Uses IFRAME

  • No post back 1

  • Synchronous processing

  • Uses IFRAME

  • No post back 1

  • Asynchronous processing

AsyncRendering = False

  • Inline HTML

  • Post back

  • Synchronous Processing

  • Inline HTML

  • Post back

  • Synchronous Processing

When AsyncRendering is set to True, post backs will occur if you subscribe to navigation events in your code, with the exception of the Drillthrough event. This event will post back regardless of event subscription. If the property is set to False, post backs will occur whether you have subscribed to events or not.

Asynchronous Mode

When the AsyncRendering property is set the True, the ReportViewer will render the report within an IFRAME on the page. By using an IFRAME, the remainder of the page can load without being blocked by the ReportViewer control.

Both local and remote processing modes use an IFRAME for rendering the report. However, there is a difference in the way the ReportViewer renders a progress indicator if it is enabled. When a report is processed locally, the progress indicator for the report cannot be rendered until all the processing is complete. When a report is processed remotely, the progress indicator, if it is enabled, is displayed while the report is being processed on the server.

Considerations for XHTML and ReportViewer Web Server Control

If you configure the ReportViewer Web server control to run in asynchronous mode in an application that is written in XHTML, you must follow specific steps to display the ReportViewer control properly. If the ReportViewer control uses relative height (for example, if the height is specified as a percentage of available space), the control collapses to a height of zero (0) pixels as a result of how frames and DIV tags render in containing tables in XHTML. You can avoid this problem by doing one of the following:

  • Explicitly set the height on the on the ReportViewer control to an actual value rather than a percentage.

  • Add the following style setting to the <head> tag: <style>html,body,form {height:100%}</style>. By forcing the HTML, body, and form tags to maximum height, the frame used in the ReportViewer control will also grow to maximum height, making it visible on the page.

  • Remove the xhtml doctype from the page.

Synchronous Mode

When the AsyncRendering property is set the False the ReportViewer will render the report as inline HTML within the rest of the page. Since the HTML is inline, the rest of the page will be blocked while the report is processed and rendered.

Note

If a report contains a document map and it is being rendered in synchronous mode, the document map will not be displayed.

See Also

Reference

ReportViewer Properties
ReportViewer

Concepts

Web.config Settings for ReportViewer
ReportViewer Web Server and Windows Forms Controls
Configuring ReportViewer for Local Processing
Configuring ReportViewer for Remote Processing