Reports for WinForms | ComponentOne
C1.Win.C1Report.4 Assembly / C1.Win.C1Preview Namespace / C1PreviewPane Class / InitializeSSRSParametersDialog Event
Example

In This Topic
    InitializeSSRSParametersDialog Event
    In This Topic
    TBD: Fired before the control displays the Report Parameters dialog when displaying SSRS report.
    Syntax
    'Declaration
     
    Public Event InitializeSSRSParametersDialog As InitializeSSRSParametersDialogEventHandler
    public event InitializeSSRSParametersDialogEventHandler InitializeSSRSParametersDialog
    Event Data

    The event handler receives an argument of type InitializeSSRSParametersDialogEventArgs containing data related to this event. The following InitializeSSRSParametersDialogEventArgs properties provide information specific to this event.

    PropertyDescription
    TBD: Gets a System.Windows.Forms.Form object that is about to be displayed.  
    TBD: Gets a C1.Win.C1Document.C1DocumentSource object parameters of that are edited.  
    TBD: Gets a C1.Win.C1Document.ParameterCollection collection, shortcut for the C1.Win.C1Document.C1DocumentSource.Parameters property.  
    TBD: Gets or sets a value that determines whether the component should display the parameters dialog.  
    TBD: Gets a value indicating whether the user causes dialog to show. This property is false when dialog showed automatically before rendering a document, true indicates that user pressed "Parameters" button in toolbar.  
    Remarks

    C1.Win.C1Document.C1DocumentSource object has Parameters collection containing parameters used to generate a report.

    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 InitializeSSRSParametersDialogEventArgs.Parameters collection.

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

    Example
    The code below uses the InitializeSSRSParametersDialog event to modify the values of the report parameters and suppress the display of the parameter dialog.
    private void c1PreviewPane1_InitializeSSRSParametersDialog(object sender, 
             InitializeSSRSParametersDialogEventArgs e)
    {
      // change parameter values
      e.Parameters["StartDate"].Value = DateTime.Now;
      
      // don't show dialog
      e.ShowDialog = false;
    }
    See Also