b8c36c6f99868853fb90abf959cd768442765a56
API/CodeSamples/Using-Constraints.md
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +#Using Constraints |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +Virtual constraints are easy to add in Izenda Reports. Complicated schemas no longer require extensive user education or the changing of database schemas. Virtual constraints allow Izenda Reports to know about all connections between tables. |
|
| 8 | + |
|
| 9 | +If there are already constraints in the database, this will work automatically. If there are no constraints in the DB schema, you could add virtual constraints manually through the Izenda API. |
|
| 10 | + |
|
| 11 | +**Note:** Constraints are *required* to use auto-joining in the Data Sources tab. |
|
| 12 | + |
|
| 13 | +Here is a very simple example of how to use virtual constraints: |
|
| 14 | + |
|
| 15 | +```csharp |
|
| 16 | +AdHocContext.Driver.AddConstraint("Account.Id", "*.AccountID"); |
|
| 17 | +AdHocContext.Driver.AddConstraint("User.Id", "*.OwnerId"); |
|
| 18 | +AdHocContext.Driver.AddConstraint("User.Id", "Account.OwnerId"); |
|
| 19 | +``` |
|
| 20 | + |
|
| 21 | +**Note:** You can use wildcards (like the * above) to add rules for all tables instead of adding constraints for each pair of tables. |
|
| ... | ... | \ No newline at end of file |