Ndapi 14.0.0

dotnet add package Ndapi --version 14.0.0
                    
NuGet\Install-Package Ndapi -Version 14.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ndapi" Version="14.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ndapi" Version="14.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Ndapi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ndapi --version 14.0.0
                    
#r "nuget: Ndapi, 14.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ndapi@14.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ndapi&version=14.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Ndapi&version=14.0.0
                    
Install as a Cake Tool

Ndapi

Build NuGet Version License OpenSSF Scorecard

Ndapi lets .NET applications read, create, modify and compile Oracle Forms modules (.fmb, .mmb, .olb, .pll). It wraps the Oracle Forms Open API in a strongly-typed C# object model: blocks, items, triggers and program units are classes with typed properties and enumerable collections.

using Ndapi;

using var module = FormModule.Open("orders.fmb");

foreach (var block in module.Blocks)
{
    foreach (var item in block.Items.Where(i => i.IsRequired))
    {
        Console.WriteLine($"{block.Name}.{item.Name}: {item.Prompt}");
    }
}

Installation

dotnet add package Ndapi

Nightly builds are published to GitHub Packages:

dotnet nuget add source "https://github.com/felipebz/ndapi/pkgs/nuget" --name "ndapi-dev"
dotnet add package Ndapi --prerelease -s "ndapi-dev"

Requirements

Ndapi calls the Open API of an Oracle Forms installation, so Forms must be installed on the machine that runs your application. Ndapi targets .NET 8 or later and supports trimming and NativeAOT.

Oracle Forms Build your app for OS
6i (6.0.8.22.1) x86 Windows
12c (12.2.1.3, 12.2.1.4, 12.2.1.19) x64 Windows, Linux
14c (14.1.2.0) x64 Windows, Linux
  • Forms 6i: run Ndapi on an STA thread, e.g. mark Main with [STAThread]. Top-level statements run on an MTA thread, and the first call then fails with Error code: Fail.
  • Linux: set ORACLE_HOME to the Forms installation. Forms itself needs Motif (libXm.so.4) and libXp.so.6.

Need another version? Open an issue.

Usage

Modify and save a module

using var module = FormModule.Open("orders.fmb");

var block = module.Blocks.First(b => b.Name == "ORDERS");
block.WhereClause = "status = 'OPEN'";

var trigger = new Trigger(block, "WHEN-NEW-RECORD-INSTANCE")
{
    Text = "message('New order');"
};

module.Save("orders_v2.fmb");

Create a module from scratch

using Ndapi.Enums;

using var module = new FormModule("EMPLOYEES");
var window = new Window(module, "MAIN");
var canvas = new Canvas(module, "MAIN") { Window = window, Width = 400, Height = 300 };

var block = new Block(module, "EMP")
{
    IsDatabaseBlock = true,
    QueryDataSourceType = QueryDataSourceType.Table,
    QueryDataSourceName = "EMP"
};

_ = new Item(block, "ENAME")
{
    ItemType = ItemType.TextItem,
    DataType = ItemDataType.Char,
    MaximumLength = 10,
    Canvas = canvas
};

module.Save("employees.fmb");

The CreateModuleDemo sample builds a complete master-detail form.

Compile

Compiling generates the .fmx/.mmx/.plx file and needs a database connection:

NdapiContext.ConnectToDatabase("scott/tiger@orcl");

using var module = FormModule.Open("orders.fmb");
module.CompileFile();

Convert to and from text

NdapiModule.ConvertToText<FormModule>("orders.fmb");   // writes orders.fmt
NdapiModule.ConvertFromText<FormModule>("orders.fmt"); // writes orders.fmb

Properties without a typed member

Every object also exposes the raw Open API accessors, keyed by the D2FP_* constants of the Forms headers:

using Ndapi.Core;

var prompt = item.GetStringProperty(NdapiConstant.D2FP_PRMPT);
item.SetNumberProperty(NdapiConstant.D2FP_PRMPT_STRID, 42);

NdapiMetadata lists the classes, their typed properties and the properties supported by the running Forms version.

Differences between Forms versions

The same code runs against every supported version. Each Forms release adds or drops properties, so some members only work on some versions: the XML documentation says so ("Forms 12c and later", "Forms 6i only"), and using one on a version that lacks it throws an NdapiException that names the property.

Things to know

  • Disposing a module you opened or created unloads it from Forms (using does it for you; Destroy() does it explicitly). Objects obtained from it are invalid afterwards.
  • The Forms API keeps one context per process. Don't use Ndapi from several threads at the same time.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net11.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
14.0.0 56 11/20/2026
13.1.0 357 6/18/2025
13.0.0 258 2/4/2024
12.2.1.33 334 11/8/2023
12.2.1.3 1,810 4/26/2018
6.0.8.2 198 11/8/2023
6.0.8.1 1,645 5/2/2018
6.0.8 1,645 4/26/2018
1.0.0 1,631 1/23/2016
1.0.0-beta1-0121 1,672 5/16/2015
1.0.0-alpha2-0100 1,681 2/24/2015
1.0.0-alpha1-0087 1,613 2/23/2015