Share via


Calling the Methods from the Case Statement

Earlier, you created a case statement in the ExportSelection() method, with multiple cases. Each case is linked to a selection from the ExportFormatType enum. You now call each of the configuration methods from the corresponding case.

To call the methods from the case statement

  1. Locate the ExportSelection() method that you created earlier.

  2. Within the Select Case [Visual Basic] or switch [C#] case statement, in the case for ExportFormatType.NoFormat, set the selectedNoFormat Boolean variable to True.

``` vb
selectedNoFormat = true
```

``` csharp
selectedNoFormat = true;
```
  1. Within the Select Case [Visual Basic] or switch [C#] case statement, in the case for ExportFormatType.CrystalReport, call the ConfigureExportToRpt() method.
``` vb
ConfigureExportToRpt()
```

``` csharp
ConfigureExportToRpt();
```
  1. Within the Select Case [Visual Basic] or switch [C#] case statement, in the case for ExportFormatType.RichText, call the ConfigureExportToRtf() method.

    ConfigureExportToRtf()
    
    ConfigureExportToRtf();
    
  2. Within the Select Case [Visual Basic] or switch [C#] case statement, in the case for ExportFormatType.WordForWindows, call the ConfigureExportToDoc() method.

``` vb
ConfigureExportToDoc()
```

``` csharp
ConfigureExportToDoc();
```
  1. Within the Select Case [Visual Basic] or switch [C#] case statement, in the case for ExportFormatType.Excel, call the ConfigureExportToXls() method.
``` vb
ConfigureExportToXls()
```

``` csharp
ConfigureExportToXls();
```
  1. Within the Select Case [Visual Basic] or switch [C#] case statement, in the case for ExportFormatType.PortableDocFormat, call the ConfigureExportToPdf() method.
``` vb
ConfigureExportToPdf()
```

``` csharp
ConfigureExportToPdf();
```
  1. Within the Select Case [Visual Basic] or switch [C#] case statement, in the case for ExportFormatType.HTML32, call the ConfigureExportToHtml32() method.
``` vb
ConfigureExportToHtml32()
```

``` csharp
ConfigureExportToHtml32();
```
  1. Within the Select Case [Visual Basic] or switch [C#] case statement, in the case for ExportFormatType.HTML40, call the ConfigureExportToHtml40() method.

    ConfigureExportToHtml40()
    
    ConfigureExportToHtml40();
    

If you are creating a project in Visual Studio 2005 or later you must complete the procedures in Creating Methods for the New Exporting Formats, before you continue to Calling the Methods to Perform the Export.