Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
Learn how to create, use, and format expressions in a View’s Data Grid within VDM.
What Are Data Grid Expressions?
Data Grid Expressions are custom, user-defined fields that can be added to a Data Grid to perform calculations, manipulate data, or enhance displayed results. They function as virtual columns and can be formatted just like standard fields.
Why Use Data Grid Expressions?
Expressions allow users to:
- Create calculated fields without modifying the database
- Perform quick calculations or text transformations
- Apply business logic directly within the grid
Example Use Case
Suppose you want to display a 10% tax based on the Total_Sales column. By creating an expression such as Total_Sales * 0.10, you can generate a new column (e.g., Tax_Amount) directly in the Data Grid.
Video Tutorial
Steps to Create and Use a Data Grid Expression
Step 1: Open Your View in VDM
Launch VDM and open the View that contains the Data Grid you want to modify.
Step 2: Right-Click Inside the Data Grid Body
Locate the Data Grid body (anywhere within the results section), then right-click and select Add New Expression from the context menu.
Step 3: Build Your Expression
In the Expression Builder window:
- Enter your formula using fields, functions, and operators (e.g.,
Total_Sales * 0.10) - Provide a meaningful alias (column name) for the expression
- Click OK to save
Tip: Use existing column names, constants, and functions to enhance your logic. For more details, see the VDM Functions and Operator Reference Guide.
Step 4: View and Format the New Expression Column
Your new expression will appear in the Data Grid as a new column.
- Format it like any other column (e.g., currency or percent)
- Rename or reposition it as needed
Tip: For more details, see How to Format Columns in VDM.
Example Output
| Total_Sales | Tax_Amount (Expression) |
|---|---|
| 100.00 | 10.00 |
| 250.00 | 25.00 |
Total_Sales * 0.10Article Summary
Data Grid Expressions in VDM provide a flexible way to enhance your views with dynamic, calculated fields. By right-clicking within the Data Grid and building a formula, you can create virtual columns that act like any other field—fully formatable and reusable. This makes it easy to layer business logic directly onto your reports without needing to edit SQL or the database.
Comments
0 comments
Please sign in to leave a comment.