Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Found errors: While running the sample code using BIRT API
vignesh
While Im running the sample java code for designing the report of my own.I have encountered this below mentioned issue:
Exception occurred executing command line.
CreateProcess: "C:Program FilesJavajre1.5.0_08binjavaw.exe" -Dfile.encoding=Cp1252 -classpath "C:Documents and SettingseclipseworkspaceBirtReportbin;C:Documents and SettingseclipseBIRTDesktopeclipsepluginscom.ibm.icu_3.8.1.v20080530.jar;C:Documents and SettingseclipseBIRTDesktopeclipsepluginscom.jcraft.jsch_0.1.37.v200803061811.jar;C:Documents and SettingseclipseBIRTDesktopeclipsepluginsjavax.activation_1.1.0.v200806101325.jar;C:Documents and SettingseclipseBIRTDesktopeclipsepluginsjavax.mail_1.4.0.v200804091730.jar;C:Documents and SettingseclipseBIRTDesktopeclipsepluginsjavax.servlet.jsp_2.0.0.v200806031607.jar;C:Documents and SettingseclipseBIRTDesktopeclipsepluginsjavax.servlet_2.4.0.v200806031604.jar;C:Documents and SettingseclipseBIRTDesktopeclipsepluginsjavax.wsdl_1.4.0.v200806030407.jar;C:Documents and SettingseclipseBIRTDesktopeclipsepluginsjavax.wsdl_1.5.1.v200806030408.jar;C:Documents and SettingseclipseBIRTDesktopeclipsepluginsjavax.xml_1.3.4.v200806030440.jar;
Pls help me to overcome from this problem.
Thanks
Find more posts tagged with
Comments
JasonW
Vignesh,
Can you post the code you are using? Also can you explain your environment?
Jason
vignesh
When i get the errors.I have set the path of list of jar whichever I got the issue.Below this is sample code referred in BIRT site.
import java.io.IOException;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.model.api.CellHandle;
import org.eclipse.birt.report.model.api.DesignConfig;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.ElementFactory;
import org.eclipse.birt.report.model.api.GridHandle;
import org.eclipse.birt.report.model.api.IDesignEngine;
import org.eclipse.birt.report.model.api.IDesignEngineFactory;
import org.eclipse.birt.report.model.api.LabelHandle;
import org.eclipse.birt.report.model.api.ReportDesignHandle;
import org.eclipse.birt.report.model.api.RowHandle;
import org.eclipse.birt.report.model.api.SessionHandle;
import org.eclipse.birt.report.model.api.SimpleMasterPageHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException;
import org.eclipse.birt.report.model.api.command.ContentException;
import org.eclipse.birt.report.model.api.command.NameException;
import com.ibm.icu.util.ULocale;
public class CreateSimpleReport {
public static void main(String[] args) {
try {
//create the report design engine configuration pointing to the BIRT runtime
DesignConfig dconfig = new DesignConfig();
dconfig.setBIRTHome("C:/BIRT_RUNTIME_2_2/birt-runtime-2_2_0/ReportEngine");
IDesignEngine engine = null;
//try to start up the eclipse platform to load any plugins and create
//a new design engine
Platform.startup( dconfig );
IDesignEngineFactory factory = (IDesignEngineFactory) Platform.createFactoryObject( IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY );
engine = factory.createDesignEngine( dconfig );
//create a new session
SessionHandle session = engine.newSessionHandle( ULocale.ENGLISH ) ;
// create a design or a template. Then create a report element factory
ReportDesignHandle design = session.createDesign();
ElementFactory efactory = design.getElementFactory();
//set my initial properties
design.setDisplayName("my Test Report");
design.setDescription("test");
design.setIconFile("/templates/blank_report.gif");
design.setFileName("c:/TEMP/sample.rptdesign");
design.setDefaultUnits("in");
design.setProperty("comments", "what not and what have you");
SimpleMasterPageHandle element = efactory.newSimpleMasterPage( "Page Master" );
DesignElementHandle footerText = efactory.newTextItem("test");
footerText.setProperty("contentType", "html");
footerText.setStringProperty("content", "MyTest");
//Add in a simple page footer to our master page
element.getPageFooter().add(footerText);
//try to add the footer to the Master Page
try {
design.getMasterPages( ).add( element );
} catch (ContentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NameException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//create a new grid element, and set the width to 100 percent of the page design
GridHandle grid = efactory.newGridItem( null, 1, 1);
grid.setWidth( "100%" );
//Add the grid to the report body
design.getBody( ).add( grid );
//create a new row
RowHandle row = (RowHandle) grid.getRows( ).get( 0 );
// Create a label and add it to the first cell.
LabelHandle label = efactory.newLabel( "Hello, world!" );
label.setText("Hello, World!");
CellHandle cell = (CellHandle) row.getCells( ).get( 0 );
cell.getContent( ).add( label );
//save the report design
design.saveAs( "c:/TEMP/sample.rptdesign" );
design.close( );
System.out.println("Finished");
} catch (ContentException e) {
e.printStackTrace();
} catch (NameException e) {
e.printStackTrace();
} catch (SemanticException e) {
e.printStackTrace();
} catch (BirtException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
JasonW
Are you running this from inside eclipse?
Is this your BIRT Home directory
C:/BIRT_RUNTIME_2_2/birt-runtime-2_2_0/ReportEngine
You should only be putting the jars in the
C:/BIRT_RUNTIME_2_2/birt-runtime-2_2_0/ReportEngine/Lib directory in your classpath. Make sure you are not putting any of the jars in
C:/BIRT_RUNTIME_2_2/birt-runtime-2_2_0/ReportEngine/plugins directory in your classpath.
Jason