[]
Renders a report using the specified rendering extension and output configuration.
public void Render(IRenderingExtension renderingExtension, StreamProvider streams)
Type | Name | Description |
---|---|---|
IRenderingExtension | renderingExtension | The IRenderingExtension used to render a report. |
StreamProvider | streams | The StreamProvider to store the rendered report output. |
var renderingExtension = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension();
DirectoryInfo di = new DirectoryInfo(@"D:\Report");
FileStreamProvider stream = new FileStreamProvider(di, "MyReport");
pageReport.Document.Render(renderingExtension, stream);
Type | Condition |
---|---|
ArgumentNullException | Thrown if the |
ReportException | Thrown if a report-specific error occurred. |
LicenseException | Thrown when a component cannot be granted a license. |
ValidationReportException | Thrown if validation problems occurred. |
ReportParameterException | Thrown when an error related to a report's parameter occurs. |
OperationCanceledException | Thrown in a thread upon cancellation of an operation that the thread was executing. |
Renders a report using the specified rendering extension with the specified values.
public void Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings)
Type | Name | Description |
---|---|---|
IRenderingExtension | renderingExtension | The IRenderingExtension used to render a report. |
StreamProvider | streams | The StreamProvider to store the rendered report output. |
NameValueCollection | settings | The NameValueCollection that contains the settings for the IRenderingExtension. |
Settings settings = new Settings();
settings.HideToolbar = true;
settings.HideMenubar = true;
settings.HideWindowUI = true;
settings.Author = "Joe Smith";
PdfRenderingExtension renderingExtension = new PdfRenderingExtension();
DirectoryInfo di = new DirectoryInfo(@"D:\Report");
FileStreamProvider exportfile = new FileStreamProvider(di, "MyReport");
pageReport.Document.Render(renderingExtension, exportfile, settings);
Type | Condition |
---|---|
ArgumentNullException | Thrown if the |
ReportException | Thrown if a report-specific error occurred. |
LicenseException | Thrown when a component cannot be granted a license. |
ValidationReportException | Thrown if validation problems occurred. |
ReportParameterException | Thrown when an error related to a report's parameter occurs. |
OperationCanceledException | Thrown in a thread upon cancellation of an operation that the thread was executing. |
Renders a report using the specified rendering extension with the specified values and refreshed data.
public void Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, bool forceDataRefresh)
Type | Name | Description |
---|---|---|
IRenderingExtension | renderingExtension | The IRenderingExtension used to render a report. |
StreamProvider | streams | The StreamProvider to store the rendered report output. |
NameValueCollection | settings | The NameValueCollection that contains the settings for the IRenderingExtension. |
bool | forceDataRefresh | Set to |
Settings settings = new Settings();
settings.HideToolbar = true;
settings.HideMenubar = true;
settings.HideWindowUI = true;
settings.Author = "Joe Smith";
PdfRenderingExtension renderingExtension = new PdfRenderingExtension();
DirectoryInfo di = new DirectoryInfo(@"D:\Report");
FileStreamProvider exportfile = new FileStreamProvider(di, "MyReport");
pageReport.Document.Render(renderingExtension, exportfile, settings, true);
Type | Condition |
---|---|
ArgumentNullException | Thrown if the |
ReportException | Thrown if a report-specific error occurred. |
LicenseException | Thrown when a component cannot be granted a license. |
ValidationReportException | Thrown if validation problems occurred. |
ReportParameterException | Thrown when an error related to a report's parameter occurs. |
OperationCanceledException | Thrown in a thread upon cancellation of an operation that the thread was executing. |
Renders a report using the specified rendering extension with the specified values and refreshed data.
public void Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, bool forceDataRefresh, bool forceParameterDataRefresh)
Type | Name | Description |
---|---|---|
IRenderingExtension | renderingExtension | The IRenderingExtension used to render a report. |
StreamProvider | streams | The StreamProvider to store the rendered report output. |
NameValueCollection | settings | The NameValueCollection that contains the settings for the IRenderingExtension. |
bool | forceDataRefresh | Set to |
bool | forceParameterDataRefresh | Set to |
Settings settings = new Settings();
settings.HideToolbar = true;
settings.HideMenubar = true;
settings.HideWindowUI = true;
settings.Author = "Joe Smith";
PdfRenderingExtension renderingExtension = new PdfRenderingExtension();
DirectoryInfo di = new DirectoryInfo(@"D:\Report");
FileStreamProvider exportfile = new FileStreamProvider(di, "MyReport");
pageReport.Document.Render(renderingExtension, exportfile, settings, true, true);
Type | Condition |
---|---|
ArgumentNullException | Thrown if the |
ReportException | Thrown if a report-specific error occurred. |
LicenseException | Thrown when a component cannot be granted a license. |
ValidationReportException | Thrown if validation problems occurred. |
ReportParameterException | Thrown when an error related to a report's parameter occurs. |
OperationCanceledException | Thrown in a thread upon cancellation of an operation that the thread was executing. |
Renders a report using the specified rendering extension with the specified values and refreshed data.
public void Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, bool forceDataRefresh, bool forceParameterDataRefresh, CancellationToken token)
Type | Name | Description |
---|---|---|
IRenderingExtension | renderingExtension | |
StreamProvider | streams | The StreamProvider to store the rendered report output. |
NameValueCollection | settings | The NameValueCollection that contains the settings for the IRenderingExtension. |
bool | forceDataRefresh | Set to |
bool | forceParameterDataRefresh | Set to |
CancellationToken | token | Allows to stop rendering |
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();
}
Type | Condition |
---|---|
ArgumentNullException | Thrown if the |
ReportException | Thrown if a report-specific error occurred. |
LicenseException | Thrown when a component cannot be granted a license. |
ValidationReportException | Thrown if validation problems occurred. |
ReportParameterException | Thrown when an error related to a report's parameter occurs. |
OperationCanceledException | Thrown in a thread upon cancellation of an operation that the thread was executing. |
Renders a report using the specified rendering extension with the specified values and refreshed data.
public void Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, bool forceDataRefresh, bool forceParameterDataRefresh, CancellationToken token, IProgress<ProgressInfo> progress)
Type | Name | Description |
---|---|---|
IRenderingExtension | renderingExtension | |
StreamProvider | streams | The StreamProvider to store the rendered report output. |
NameValueCollection | settings | The NameValueCollection that contains the settings for the IRenderingExtension. |
bool | forceDataRefresh | Set to |
bool | forceParameterDataRefresh | Set to |
CancellationToken | token | Allows to stop rendering |
IProgress<ProgressInfo> | progress | The IProgress<T> of type ProgressInfo provides progress updates. |
labelExport.Text = "Export started";
var control = this;
var progress = new Progress<ProgressInfo>(progressInfo =>
{
control.BeginInvoke(new MethodInvoker(() =>
{
labelExport.Text = progressInfo.IsLast ? "Export is finished." : $"Exported {progressInfo.PageNumber} pages.";
}));
});
await Task.Run(() =>
{
report.Document.Render(renderingExtension, outputProvider, settings, false, false, CancellationToken.None, progress);
});
Type | Condition |
---|---|
ArgumentNullException | Thrown if the |
ReportException | Thrown if something is wrong with the structure of the report. |
LicenseException | Thrown when a component cannot be granted a license. |
ValidationReportException | Thrown if validation problems occurred. |
ReportParameterException | Thrown when an error related to a report's parameter occurs. |
OperationCanceledException | Thrown in a thread upon cancellation of an operation that the thread was executing. |