Fired before the control displays the Report Parameters dialog.

Namespace:  C1.C1Report
Assembly:  C1.C1Report.2 (in C1.C1Report.2.dll)

Syntax

C#
public event DialogEventHandler InitializeParametersDialog
Visual Basic
Public Event InitializeParametersDialog As DialogEventHandler

Remarks

Reports that have a PARAMETERS clause in their RecordSource property show a dialog where the user can enter report parameters.

This event fires before the dialog is displayed and allows you to customize the dialog by changing its caption, font, colors, etc.

You can also use this event to inspect and modify parameter values using the Parameters collection.

Finally, you can use the ShowDialog property to prevent the component from showing the parameters dialog.

Examples

The following code uses the InitializeParametersDialog event to modify the values of the report parameters and suppress the display of the parameter dialog:

Copy CodeVisual Basic
Private Sub c1r_InitializeParametersDialog(ByVal sender As Object, ByVal e As C1.C1Report.DialogEventArgs) Handles c1r.InitializeParametersDialog
' change parameter values
Dim p As ReportParameterCollection = e.Parameters
    p("TheString").Value = "east"
    p("TheNumber").Value = 12
    p("TheDate").Value = DateTime.Now
    p("TheBool").Value = True
    ' don't show dialog
    e.ShowDialog = False
End Sub
Copy CodeC#
private void c1r_InitializeParametersDialog(object sender, 
C1.C1Report.DialogEventArgs e)
{
    // change parameter values
    ReportParameterCollection p = e.Parameters;
    p["TheString"].Value = "east";
    p["TheNumber"].Value = 12;
    p["TheDate"].Value   = DateTime.Now;
    p["TheBool"].Value   = true;
    // don't show dialog
    e.ShowDialog = false;
}

See Also