This example demonstrates the following ODataDB features:
Here is an embedded form.
To embed the form, include db.css in the head, db.js at the bottom, and place the control like this:
<div class="db-control" data-app="odatadb" data-url="v4/mssql-041/default/en-us/usp_order_form()"></div>
To test dynamic parameter values, change the category in the first parameter.
This will update the value lists in the other parameters.
The concept is straightforward. Just add a parameter to a stored procedure that selects values.
You can find the source code for the procedures in the code browser below.
Here is the configuration of parameter values.
To test calculated columns, modify the amount in any cell.
The trick is using the formula =[@amount]*[@price] in the Total column, defined in the view_items.
ODataDB supports Excel formulas that utilize column names and JavaScript-compatible operators.
This sample loads formatting rules from the xls.handlers table.
You can use the free version of the SaveToDB add-in to convert Excel conditional formatting to these formats.
Use Wizards, Developer Tools, and Show Table Format.
Another exciting feature is protecting cells using cell change handlers.
Try deleting any name or setting the amount in the category line.
The server returns error 500, and ODataDB rolls back the change.
To prevent cell changes, raise an exception. For example, in SQL Server, use RAISERROR (@message, 11, 0).
Here is an SQL definition of the s04.usp_order_form_change procedure used as a handler.
This sample illustrates how database developers can create interactive web forms.
Simply create a cell change handler, procedures to select parameter values, and add conditional formatting.
Use Excel formulas for calculated columns and embed the form into any corporate web page.
You can download samples for any supported database platform with the SaveToDB SDK.
© 2025 Gartle LLC | www.odatadb.com | ODataDB Guide | Developer Guide | Privacy Policy | Cookie Policy