CrystalReportViewer.SelectionFormula Eigenschaft

Ruft die Formel für die Datensatzauswahl des Berichts ab oder legt sie fest.

Namespace CrystalDecisions.Windows.Forms Assembly CrystalDecisions.Windows.Forms (CrystalDecisions.Windows.Forms.dll)

Syntax

Public NotInheritable Property SelectionFormula As String
public sealed string SelectionFormula {get; set;}

Beispiel

In diesem Beispiel wird veranschaulicht, wie die SelectionFormula-Eigenschaft für den Bericht festgelegt wird.

    Private Sub SetSelectionFormula(ByVal mySalesAmount As String, ByVal myCustomerName As String)
      Dim mySelectionFormula As String = "{Customer.Last Year's Sales} > " & mySalesAmount _
      & " AND Mid({Customer.Customer Name}, 1) > """ & myCustomerName & """"
      CrystalReportViewer.SelectionFormula = mySelectionFormula
    End Sub
    private void SetSelectionFormula(String salesAmount, String customerName)
    {
      String selectionFormula = "{Customer.Last Year's Sales} > " + salesAmount
        + " AND Mid({Customer.Customer Name}, 1) > \"" + customerName + "\"";
      crystalReportViewer.SelectionFormula = selectionFormula;
    }

Versionsinformationen

Crystal Reports Basic for Visual Studio 2008

Unterstützt ab: Crystal Reports for Visual Studio .NET 2002

Siehe auch

Referenz

CrystalReportViewer Klasse
CrystalReportViewer Elemente
CrystalDecisions.Windows.Forms Namespace