[]
        
(Showing Draft Content)

C1.WPF.FlexReport.C1FlexReport.DoEvents

DoEvents Property

DoEvents

Specifies whether the control should handle Windows messages while rendering reports in synchronious mode.

Declaration
public bool DoEvents { get; set; }
Remarks
<p>Setting this property to true allows users to resize forms, click buttons, etc. while reports are 

being generated in synchronious mode. This makes applications more responsive, and is necessary if you want to provide a "Cancel Report" button (otherwise users wouldn't be able to click the button until the report was done).

Setting this property to false will cause reports to render slightly faster.

Examples
<p>The code below implements "Render" and a "Cancel" buttons attached to a <xref href="C1.WPF.FlexReport.C1FlexReport" data-throw-if-not-resolved="false"></xref> component.</p>
<p>The "Render" button checks whether the <xref href="C1.WPF.FlexReport.C1FlexReport" data-throw-if-not-resolved="false"></xref> component is busy before starting to render a report.

This is necessary because the user could click the "Render" button several times in a row, before the component got a chance to finish rendering the report. (Calling the Render() method while the component is busy throws an Exception).

The "Cancel" button checks whether the component is rendering a report and sets the Cancel property to true.

<pre><code class="lang-csharp">_c1r.DoEvents = true;

private void Render_Click(object sender, EventArgs e)
{
   if (_c1r.IsBusy)
   {
       Console.WriteLine("Cannot render now, component is busy");
   } 
   else 
   {
       ppv.Document = c1r;
   } 
}
private void Cancel_Click(object sender, EventArgs e) 
{
   if (_c1r.IsBusy) 
   {
       _c1r.Cancel = true;
   } 
   else 
   {
       Console.WriteLine("No report to cancel");
   }
}</code></pre>