eclipse.birt.report.engine.api.IReportRunnable;
Deployment
[ 264 ]
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
public class ReportExecutor {
private static String BIRT_HOME = "C:/BIRT_RUNTIME_2_2/birt-runtime-
2_2_0/ReportEngine";
private static String IMAGE_PATH = "C:/BIRT_RUNTIME_2_2/images";
private String reportLocation;
private String reportOutputLocation;
/**
* setupCLIParameters
*
* This will setup the arguments
* @return
*/
public Options setupCLIParameters()
{
Options options = new Options();
options.addOption("i", "input", true, "The report file to execute");
options.addOption("o", "output", true, "The name of the output file");
return options;
}
/**
* parseCommandLineOptions
*
* Given the arguments passed into main, this method will use the
* Apache Commons CLI
* to parse those options and return
* a CommandLine object with the options
*
* @param args
* @return CommandLine
*/
public CommandLine parseCommandLineOptions(String []args)
{
//First, parse the command line options using Apache Commons CLI
CommandLineParser parser = new PosixParser();
Options options = setupCLIParameters();
CommandLine line = null;
HelpFormatter formatter = new HelpFormatter();
//Try to parse the command line options, exit the app if there is an
error
try {
//Get the options
line = parser.
Pages:
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215