Customer Portal

If you haven’t already, register for the Customer Portal: unlock a wealth of useful information and submit cases in an easier, more efficient way! Find out more here.

Example automation code - C# Dotnet

See also: available COM commands

// This example uses the ocx control. You may also use interopservices to launch OyezForms.
//
In the form's design view, right-click in the 'General' area of the Toolbox panel and select 'Choose Items...'
// In the 'Choose Toolbox Items' dialog, select the 'COM Components' tab
// Scroll down the list of components and put a tick next to 'OyezV8EZ', then click 'OK'.
// The ocx will appear on the Toolbar. Double-click on it to add it to the form.

axOyezV8EZ1.createserver(); // create OyezForms application server
Boolean b = axOyezV8EZ1.NewForm("DIV_E");

axOyezV8EZ1.maximise(); //always maximise as a first act to ensure current instances are found

//Retrieve an array of field labels in the form
//(for presenting mapping options to users)

for(int x=1; x<=axOyezV8EZ1.Pages; x++)
{
axOyezV8EZ1.selectpage(x);
string[] Lbllst = axOyezV8EZ1.labellist().Split(',');
     foreach (string Lbl in Lbllst)
     {
     }
}
axOyezV8EZ1.selectpage(1);  //select first page again

// field labels are the recommended route for filling values into forms
// they are stable, both across form revisions, and across forms within a range.

axOyezV8EZ1.fill("Petitioner", "Mrs Divor");
axOyezV8EZ1.fill("Respondent", "Mr Divor");

// field IDs can also be used for data filling, but these change between form revisions
// you should provide a mapping interface to them for compatibility with a small number of older forms

string[] Idlst = axOyezV8EZ1.FieldList.Split(',');
axOyezV8EZ1.fillfield(6, "12345-789");

//save the form to a path
axOyezV8EZ1.store(@"c:\temp\test.olf");

//read path to OyezFrms.exe
//this is useful for locating the \library\mastlibr.mdb file that contains details
//of all available form templates - see documention

string progpath = axOyezV8EZ1.executablepath();

//You can target a printer programmatically
// name, tray, duplex (due to printer variance, duplex cannot be guaranteed)
//see commands documentation for return values

axOyezV8EZ1.finishfilling(0); //Guarantee update of display prior to printing.
long tprnt = axOyezV8EZ1.targetprint("HP LaserJet 1020", 2, 0);
axOyezV8EZ1.print(1, 1); //output first page only

//or print to the current program default printer
//OyezForms will select a printer in this order:
//1. set in Tools > Options > Print: 'Initial Printer'
//2. System default
//you can specify ranges of pages, this example prints all. see COM interface documentation

axOyezV8EZ1.finishfilling(0); //Guarantee update of display prior to printing.
axOyezV8EZ1.print(1, axOyezV8EZ1.Pages); //print all pages

//export form to a flattened PDF
//and allow processing to complete before next action

//see command documentation for return values
axOyezV8EZ1.finishfilling(0); //Guarantee update of display prior to export.
axOyezV8EZ1.setpagetoprint("1,2,3"); //Print section 1 only
long PDFres = axOyezV8EZ1.exporttoPDF(@"c:\temp\out.pdf");
while (axOyezV8EZ1.ActionsComplete() != true)
{
System.Windows.Forms.Application.DoEvents();
}

//close form
axOyezV8EZ1.discard();
//exit application server
axOyezV8EZ1.exit();

}