ActiveReports 19 .NET Edition
MESCIUS.ActiveReports Assembly / GrapeCity.ActiveReports.Document Namespace / PageDocument Class / Render Method / Render(IRenderingExtension,StreamProvider,NameValueCollection,Boolean,Boolean,CancellationToken) Method
The GrapeCity.ActiveReports.Extensibility.Rendering.IO.StreamProvider to store the rendered report output.
The System.Collections.Specialized.NameValueCollection that contains the settings for the GrapeCity.ActiveReports.Extensibility.Rendering.IRenderingExtension.
Set to True to force a refresh or query of the data even if the DataMap has already retrieved the required data.
Set to True to force a refresh or query of the parameter data.
Allows to stop rendering
Example

In This Topic
    Render(IRenderingExtension,StreamProvider,NameValueCollection,Boolean,Boolean,CancellationToken) Method
    In This Topic
    Renders a report using the specified rendering extension with the specified values and refreshed data.
    Syntax
    'Declaration
     
    Public Overloads Sub Render( _
       ByVal renderingExtension As IRenderingExtension, _
       ByVal streams As StreamProvider, _
       ByVal settings As NameValueCollection, _
       ByVal forceDataRefresh As Boolean, _
       ByVal forceParameterDataRefresh As Boolean, _
       ByVal token As CancellationToken _
    ) 

    Parameters

    renderingExtension
    streams
    The GrapeCity.ActiveReports.Extensibility.Rendering.IO.StreamProvider to store the rendered report output.
    settings
    The System.Collections.Specialized.NameValueCollection that contains the settings for the GrapeCity.ActiveReports.Extensibility.Rendering.IRenderingExtension.
    forceDataRefresh
    Set to True to force a refresh or query of the data even if the DataMap has already retrieved the required data.
    forceParameterDataRefresh
    Set to True to force a refresh or query of the parameter data.
    token
    Allows to stop rendering
    Exceptions
    ExceptionDescription
    Thrown if the renderingExtension or streams is null.
    Thrown if a report-specific error occured.
    Thrown when a component cannot be granted a license.
    Thrown if validation problems occurred.
    Thrown when an error related to a report's parameter occurs.
    Thrown in a thread upon cancellation of an operation that the thread was executing.
    Example
    private CancellationTokenSource _cancellationTokenSource;
    private async void ExportAsync(PageReport report, IRenderingExtension renderingExtension, FileStreamProvider outputProvider, NameValueCollection settings)
    {
    	_cancellationTokenSource = new CancellationTokenSource();
    	cancelButton.Text = "Cancel";
    	await Task.Run(() =>
    	{
    		try
    		{
    			report.Document.Render(renderingExtension, outputProvider, settings, false, false, _cancellationTokenSource.Token);
    		}
    		catch (OperationCanceledException)
    		{
    		}
    	});
    	if (_cancellationTokenSource.IsCancellationRequested)
    	MessageBox.Show("Export was cancelled", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
    	_cancellationTokenSource.Dispose();
    }
    private void cancelExport(object sender, EventArgs e)
    {
    	_cancellationTokenSource?.Cancel();
    }
    See Also