# FilterInstruction Constructor

> Initializes a new instance of the FilterInstruction class.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 26.0
- **Namespace:** `TXTextControl.DocumentServer.DataShaping`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.DocumentServer.DataShaping > FilterInstruction Constructor
- **1926 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/constructor/llms-full.txt

---

### Description

Initializes a new instance of the FilterInstruction class.

### Syntax

#### FilterInstruction(string, RelationalOperator, object, LogicalOperator)

Sets the table column name to filter the data rows by, the comparison operator, the value to compare the table column content to and the logical operator.

```csharp
public FilterInstruction(string columnName, RelationalOperator comparisonOperator, object compareTo, LogicalOperator logicalOperator);
```

```vbnet
Public Sub New(columnName As String, comparisonOperator As RelationalOperator, compareTo As Object, logicalOperator As LogicalOperator)
```

| Parameter | Description |
|---|---|
| columnName | The name of the table column to filter the data rows by. |
| comparisonOperator | The comparison operator.  \| Value \| Meaning \| \| Equals \| "Equals" relation. \| \| NotEqual \| "Not equal" relation. \| \| LessThan \| "Less than" relation. \| \| GreaterThan \| "Greater than" relation. \| \| GreaterThanOrEqualTo \| "Greater than or equal to" relation. \| \| LessThanOrEqualTo \| "Less than or equal to" relation. \| \| IsBlank \| "Is blank" constraint. \| \| IsNotBlank \| "Is not blank" constraint. \| |
|---|

| compareTo | The value to compare the table column content to. If this value can be parsed to a numerical value, numerical comparisons are used internally when possible (i. e. when the table column contains numerical values, too). Otherwise the column content and this value are interpreted as strings. |
|---|---|

| logicalOperator | The logical operator which connects a filter instruction to the previous filter instruction in a collection. |

| Value | Meaning |
| And | Logical "and". |
| Or | Logical "or". |

#### FilterInstruction(string, RelationalOperator, object)

Sets the table column name to filter the data rows by, the comparison operator and the value to compare the table column content to. The logical operator is set to `LogicalOperator.And`.

```csharp
public FilterInstruction(string columnName, RelationalOperator comparisonOperator, object compareTo);
```

```vbnet
Public Sub New(columnName As String, comparisonOperator As RelationalOperator, compareTo As Object)
```

| Parameter | Description |
|---|---|
| columnName | The name of the table column to filter the data rows by. |
| comparisonOperator | The comparison operator.  \| Value \| Meaning \| \| Equals \| "Equals" relation. \| \| NotEqual \| "Not equal" relation. \| \| LessThan \| "Less than" relation. \| \| GreaterThan \| "Greater than" relation. \| \| GreaterThanOrEqualTo \| "Greater than or equal to" relation. \| \| LessThanOrEqualTo \| "Less than or equal to" relation. \| \| IsBlank \| "Is blank" constraint. \| \| IsNotBlank \| "Is not blank" constraint. \| |
|---|

| compareTo | The value to compare the table column content to. If this value can be parsed to a numerical value, numerical comparisons are used internally when possible (i. e. when the table column contains numerical values, too). Otherwise the column content and this value are interpreted as strings. |
|---|---|

#### FilterInstruction(string, RelationalOperator)

Sets the table column name to filter the data rows by and the comparison operator. The value to compare the table column content to is set to the empty string and the logical operator is set to <code>LogicalOperator.And</code>. This constructor is useful in cases of "is blank" or "is not blank" filter instructions because no compare value is needed in those cases.

```csharp
public FilterInstruction(string columnName, RelationalOperator comparisonOperator);
```

```vbnet
Public Sub New(columnName As String, comparisonOperator As RelationalOperator)
```

| Parameter | Description |
| columnName | The name of the table column to filter the data rows by. |
| comparisonOperator | The comparison operator.  \| Value \| Meaning \| \| Equals \| "Equals" relation. \| \| NotEqual \| "Not equal" relation. \| \| LessThan \| "Less than" relation. \| \| GreaterThan \| "Greater than" relation. \| \| GreaterThanOrEqualTo \| "Greater than or equal to" relation. \| \| LessThanOrEqualTo \| "Less than or equal to" relation. \| \| IsBlank \| "Is blank" constraint. \| \| IsNotBlank \| "Is not blank" constraint. \| |
|---|

### Examples

The following example creates a Filter Instruction instance and configures its column name setting for a document workflow.

```csharp
TXTextControl.DocumentServer.DataShaping.FilterInstruction filterInstruction = new("CustomerName", TXTextControl.DocumentServer.DataShaping.RelationalOperator.Equals);
filterInstruction.ColumnName = "CustomerName";
```

```vbnet
Dim filterInstruction As New TXTextControl.DocumentServer.DataShaping.FilterInstruction("CustomerName", TXTextControl.DocumentServer.DataShaping.RelationalOperator.Equals)
filterInstruction.ColumnName = "CustomerName"
```

---

## Nearby

- **Previous:** [FilterInstruction.ComparisonOperator Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/comparisonoperator-property/llms-full.txt)
- **Next:** [FilterInstruction.Culture Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/culture-property/llms-full.txt)
