News, Events, Conferences, What's New About, Partners, Jobs Phone, E-mail, Address, Location Free Evaluation


home
products
product videos
customer support


Resources
Frequently Asked Questions

The simplest sample for connecting to Harmoni and generating a report

Microsoft Word Engine

import com.dynalivery.harmoni.*;
import com.dynalivery.word.*;
class DynaliverySimpleApp {

  public static void main(String [] args) 
  {
    HarmoniApplicationClient client = null;
    WordEngine engine = null;
    WordJob job = null;
    try {
        client = new HarmoniApplicationClient();
        client.ConnectToHost("", HarmoniApplicationClient.WORD);
        engine = client.OpenWordEngine();
        job = engine.OpenJob("\\filename.doc");
        //HTMLFormatOptions options = new HTMLFormatOptions(FileType.HTML,false); //  html output       
        //job.OutputTo("\\OutputFileName.html", options);  
        PDFFormatOptions options = new PDFFormatOptions(); // for pdf output
        job.OutputTo("\\OutputFileName.pdf", options);
        job.Start();
        job.Close();
        System.out.println("Report Finished");
        engine.Close();
    }catch ( HarmoniError error ){
	System.out.println("Exception: "+ error);
    }catch ( Exception ex ){
	System.out.println("Exception: "+ ex);
    }finally{
 	 if (client !=null) client.Quit();
    }
  }
}   

Crystal Reports Engine

import com.dynalivery.harmoni.*;
import com.dynalivery.crystal.*;
class DynaliverySimpleApp {

  public static void main(String [] args) 
  {
    HarmoniApplicationClient client = null;
    PCREEngine engine = null;
    PCREJob job = null;
    try {
        client = new HarmoniApplicationClient();
        client.ConnectToHost(<servername>t", HarmoniApplicationClient.CRYSTAL7);
        //client.ConnectToHost(<servername>t", HarmoniApplicationClient.CRYSTAL9); // For Crystal-9 engine
        engine = client.OpenCrystalEngine();
        job = engine.OpenJob(\\filename.rpt");
        //HTMLFormatOptions options = new HTMLFormatOptions(FileType.HTML,false); //  html output       
        //job.OutputTo("\\OutputFileName.html", options);  
        PDFFormatOptions options = new PDFFormatOptions(); // for pdf output
        job.OutputTo("\\OutputFileName.pdf", options);
        job.Start();
        job.Close();
        System.out.println("Report Finished");
        engine.Close();
    }catch ( HarmoniError error ){
	System.out.println("Exception: "+ error);
    }catch ( Exception ex ){
	System.out.println("Exception: "+ ex);
    }finally{
 	 if (client !=null) client.Quit();
    }
  }
}        

BACK TO TOP
BACK TO STAR

© 2000-2005 Dynalivery Corporation
formerly Mobile Application Servers, Inc.