Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Trying to use REAPI: Report engine can not create HTML emitter
Trying to use REAPI: Report engine can not create HTML emitter [message #363730] Mon, 07 July 2008 19:59 Go to next message
Eclipse UserFriend
Originally posted by: Rich.Court.gmail.com

Hi-

I'm attempting to run a report from a java application using the Report
Engine API. I've looked over the examples and some of the messages
posted here, and believe I am correctly calling the code.

However, I am receiving the error "Jul 7, 2008 3:45:46 PM
org.eclipse.birt.report.engine.api.impl.EngineTask createContentEmitter
SEVERE: Report engine can not create HTML emitter." so I am doing
something wrong.

I'm wondering if someone could point me to a checklist of standard
things I should be checking?

[When I trace this using the debugger, the failure seems to be caused by
a null return value when I am testing whether the emitter is an instance
of IContentEmitter...]

Thanks,
-Rich
Re: Trying to use REAPI: Report engine can not create HTML emitter [message #363731 is a reply to message #363730] Mon, 07 July 2008 20:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Rich.Court.gmail.com

I seem to be missing a required library.

Could someone point me to what is supposed to be installed where?

Thanks,
-R

Rich Court wrote:
> Hi-
>
> I'm attempting to run a report from a java application using the Report
> Engine API. I've looked over the examples and some of the messages
> posted here, and believe I am correctly calling the code.
>
> However, I am receiving the error "Jul 7, 2008 3:45:46 PM
> org.eclipse.birt.report.engine.api.impl.EngineTask createContentEmitter
> SEVERE: Report engine can not create HTML emitter." so I am doing
> something wrong.
>
> I'm wondering if someone could point me to a checklist of standard
> things I should be checking?
>
> [When I trace this using the debugger, the failure seems to be caused by
> a null return value when I am testing whether the emitter is an instance
> of IContentEmitter...]
>
> Thanks,
> -Rich
Re: Trying to use REAPI: Report engine can not create HTML emitter [message #363734 is a reply to message #363731] Mon, 07 July 2008 23:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Rich,

Are you using the runtime download? Are you setting BIRT_HOME correctly?

Jason

Rich Court wrote:
> I seem to be missing a required library.
>
> Could someone point me to what is supposed to be installed where?
>
> Thanks,
> -R
>
> Rich Court wrote:
>> Hi-
>>
>> I'm attempting to run a report from a java application using the
>> Report Engine API. I've looked over the examples and some of the
>> messages posted here, and believe I am correctly calling the code.
>>
>> However, I am receiving the error "Jul 7, 2008 3:45:46 PM
>> org.eclipse.birt.report.engine.api.impl.EngineTask createContentEmitter
>> SEVERE: Report engine can not create HTML emitter." so I am doing
>> something wrong.
>>
>> I'm wondering if someone could point me to a checklist of standard
>> things I should be checking?
>>
>> [When I trace this using the debugger, the failure seems to be caused
>> by a null return value when I am testing whether the emitter is an
>> instance of IContentEmitter...]
>>
>> Thanks,
>> -Rich
Re: Trying to use REAPI: Report engine can not create HTML emitter [message #363764 is a reply to message #363734] Tue, 08 July 2008 14:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Rich.Court.gmail.com

Yes, I'm using the runtime download. I believe I am setting BIRT_HOME
correctly. The application seems to correctly startup the platform,
opens the .rptdesign file and successfully retrieves info from that. I
seem to be unsuccessful at executing a task.run() call.

Here's the source that I am attempting to use:

---
public class BIRTStandaloneTest {

private String BIRT_HOME =
" C:\\birt_2.3_final_runtime\\birt-runtime-2_3_0\\ReportEngine ";
private String REPORT_DESIGN_FILE =
"C:\\temp\\reports\\Demo_DB_with_Chart_2.3.rptdesign";
private String OUTPUT_FILE_LOCATION_RENDER =
"C:\\temp\\output\\myTestOutputRender_2.3.html";
private String OUTPUT_FILE_LOCATION_RUN_RENDER =
"C:\\temp\\output\\myTestOutputRunRender_2.3.html";
private IReportEngine engine;


public BIRTStandaloneTest( )
{
String designName = "Demo_DB_with_Chart_2.3.rptdesign";
designName = REPORT_DESIGN_FILE;

IReportEngine engine = null;
EngineConfig config = null;

config = new EngineConfig();

config.setBIRTHome(BIRT_HOME);
config.setLogConfig("C:\\temp\\output\\birt_2_3_final\\logs ", Level.ALL);

try {
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory)
Platform.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
engine = factory.createReportEngine(config);
engine.changeLogLevel(Level.ALL);
} catch (Exception e) {
e.printStackTrace();
}
IReportRunnable design = null;
try {
design = engine.openReportDesign(designName);
} catch (EngineException e) {
System.err.println("Design " + designName + " not found");
tearDown();
System.exit(-1);
}
System.out.println("Opened .rptdesign file " + designName + "
correctly.");
// Just check something in the file to make sure we opened it
correctly, and can correctly fetch fields.
String author = (String) design.getProperty(IReportRunnable.AUTHOR);
System.out.println("Design author fetch = " + author);

IRunAndRenderTask task = engine.createRunAndRenderTask(design);

RenderOption renderOption = new RenderOption();
renderOption.setOutputFormat("HTML");
renderOption.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN _RENDER);


// Set the context
HTMLRenderContext renderContext = new HTMLRenderContext();
renderContext.setImageDirectory("image");
renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
//apply rendering context to the task
HashMap appContext = new HashMap();
appContext.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
renderContext);
task.setAppContext(appContext);

renderOption.setOutputStream(System.out);
task.setRenderOption(renderOption);

//task.validateParameters();

try {
long beginTime = System.currentTimeMillis();
task.run();
long endTime = System.currentTimeMillis();
long timeSpan = endTime - beginTime;
System.out.println("Report Runtime: " + timeSpan);
} catch (EngineException ee) {
ee.printStackTrace();
}

task.close();
tearDown();

}


public void tearDown() {
engine.shutdown();
Platform.shutdown();
}

public static void main(String[] args) {
new BIRTStandaloneTest();
System.out.println("HTML should have been generated.");
}
}

---

Thanks for any / all advice.
-Rich



Jason Weathersby wrote:
> Rich,
>
> Are you using the runtime download? Are you setting BIRT_HOME correctly?
>
> Jason
>
> Rich Court wrote:
>> I seem to be missing a required library.
>>
>> Could someone point me to what is supposed to be installed where?
>>
>> Thanks,
>> -R
>>
>> Rich Court wrote:
>>> Hi-
>>>
>>> I'm attempting to run a report from a java application using the
>>> Report Engine API. I've looked over the examples and some of the
>>> messages posted here, and believe I am correctly calling the code.
>>>
>>> However, I am receiving the error "Jul 7, 2008 3:45:46 PM
>>> org.eclipse.birt.report.engine.api.impl.EngineTask createContentEmitter
>>> SEVERE: Report engine can not create HTML emitter." so I am doing
>>> something wrong.
>>>
>>> I'm wondering if someone could point me to a checklist of standard
>>> things I should be checking?
>>>
>>> [When I trace this using the debugger, the failure seems to be caused
>>> by a null return value when I am testing whether the emitter is an
>>> instance of IContentEmitter...]
>>>
>>> Thanks,
>>> -Rich
Re: Trying to use REAPI: Report engine can not create HTML emitter [message #363769 is a reply to message #363764] Tue, 08 July 2008 16:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Rich,

Try replacing this code:
RenderOption renderOption = new RenderOption();
> renderOption.setOutputFormat("HTML");
> renderOption.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN _RENDER);
>
>
> // Set the context
> HTMLRenderContext renderContext = new HTMLRenderContext();
> renderContext.setImageDirectory("image");
> renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
> //apply rendering context to the task
> HashMap appContext = new HashMap();
> appContext.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
> renderContext);
> task.setAppContext(appContext);
>
> renderOption.setOutputStream(System.out);
> task.setRenderOption(renderOption);

With:
HTMLRenderOption options = New HTMLRenderOption();
options.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN_REND ER);
options.setOutputFormat("html");
//options.setHtmlRtLFlag(false);
options.setEmbeddable(true);
//options.setImageDirectory("C:\\test\\images");

//PDFRenderOption options = new PDFRenderOption();
//options.setOutputFileName("c:/temp/test.pdf");
//options.setOutputFormat("pdf");

task.setRenderOption(options);

Do not use the RenderContext class.

Jason

Rich Court wrote:
> Yes, I'm using the runtime download. I believe I am setting BIRT_HOME
> correctly. The application seems to correctly startup the platform,
> opens the .rptdesign file and successfully retrieves info from that. I
> seem to be unsuccessful at executing a task.run() call.
>
> Here's the source that I am attempting to use:
>
> ---
> public class BIRTStandaloneTest {
>
> private String BIRT_HOME =
> " C:\\birt_2.3_final_runtime\\birt-runtime-2_3_0\\ReportEngine ";
> private String REPORT_DESIGN_FILE =
> "C:\\temp\\reports\\Demo_DB_with_Chart_2.3.rptdesign";
> private String OUTPUT_FILE_LOCATION_RENDER =
> "C:\\temp\\output\\myTestOutputRender_2.3.html";
> private String OUTPUT_FILE_LOCATION_RUN_RENDER =
> "C:\\temp\\output\\myTestOutputRunRender_2.3.html";
> private IReportEngine engine;
>
>
> public BIRTStandaloneTest( )
> {
> String designName = "Demo_DB_with_Chart_2.3.rptdesign";
> designName = REPORT_DESIGN_FILE;
>
> IReportEngine engine = null;
> EngineConfig config = null;
>
> config = new EngineConfig();
>
> config.setBIRTHome(BIRT_HOME);
> config.setLogConfig("C:\\temp\\output\\birt_2_3_final\\logs ", Level.ALL);
>
> try {
> Platform.startup( config );
> IReportEngineFactory factory = (IReportEngineFactory)
> Platform.createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
> engine = factory.createReportEngine(config);
> engine.changeLogLevel(Level.ALL);
> } catch (Exception e) {
> e.printStackTrace();
> }
> IReportRunnable design = null;
> try {
> design = engine.openReportDesign(designName);
> } catch (EngineException e) {
> System.err.println("Design " + designName + " not found");
> tearDown();
> System.exit(-1);
> }
> System.out.println("Opened .rptdesign file " + designName + "
> correctly.");
> // Just check something in the file to make sure we opened it
> correctly, and can correctly fetch fields.
> String author = (String)
> design.getProperty(IReportRunnable.AUTHOR);
> System.out.println("Design author fetch = " + author);
>
> IRunAndRenderTask task = engine.createRunAndRenderTask(design);
>
> RenderOption renderOption = new RenderOption();
> renderOption.setOutputFormat("HTML");
> renderOption.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN _RENDER);
>
>
> // Set the context
> HTMLRenderContext renderContext = new HTMLRenderContext();
> renderContext.setImageDirectory("image");
> renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
> //apply rendering context to the task
> HashMap appContext = new HashMap();
> appContext.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
> renderContext);
> task.setAppContext(appContext);
>
> renderOption.setOutputStream(System.out);
> task.setRenderOption(renderOption);
>
> //task.validateParameters();
>
> try {
> long beginTime = System.currentTimeMillis();
> task.run();
> long endTime = System.currentTimeMillis();
> long timeSpan = endTime - beginTime;
> System.out.println("Report Runtime: " + timeSpan);
> } catch (EngineException ee) {
> ee.printStackTrace();
> }
>
> task.close();
> tearDown();
>
> }
>
>
> public void tearDown() {
> engine.shutdown();
> Platform.shutdown();
> }
>
> public static void main(String[] args) {
> new BIRTStandaloneTest();
> System.out.println("HTML should have been generated.");
> }
> }
>
> ---
>
> Thanks for any / all advice.
> -Rich
>
>
>
> Jason Weathersby wrote:
>> Rich,
>>
>> Are you using the runtime download? Are you setting BIRT_HOME correctly?
>>
>> Jason
>>
>> Rich Court wrote:
>>> I seem to be missing a required library.
>>>
>>> Could someone point me to what is supposed to be installed where?
>>>
>>> Thanks,
>>> -R
>>>
>>> Rich Court wrote:
>>>> Hi-
>>>>
>>>> I'm attempting to run a report from a java application using the
>>>> Report Engine API. I've looked over the examples and some of the
>>>> messages posted here, and believe I am correctly calling the code.
>>>>
>>>> However, I am receiving the error "Jul 7, 2008 3:45:46 PM
>>>> org.eclipse.birt.report.engine.api.impl.EngineTask createContentEmitter
>>>> SEVERE: Report engine can not create HTML emitter." so I am doing
>>>> something wrong.
>>>>
>>>> I'm wondering if someone could point me to a checklist of standard
>>>> things I should be checking?
>>>>
>>>> [When I trace this using the debugger, the failure seems to be
>>>> caused by a null return value when I am testing whether the emitter
>>>> is an instance of IContentEmitter...]
>>>>
>>>> Thanks,
>>>> -Rich
Re: Trying to use REAPI: Report engine can not create HTML emitter [message #363787 is a reply to message #363769] Tue, 08 July 2008 18:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Rich.Court.gmail.com

First off, thank you for your time and your help.

I still receive the same error even when I take out all the
RenderContext references.
I did try changing the code from an HTMLRenderOption to a
PDFRenderOption using the code you provided that was commented out. In
that case, I get a Report engine fails to initialize pdf emitter rather
than an html emitter.

With the stack trace:
SEVERE: Report engine can not create pdf emitter.
org.eclipse.birt.report.engine.api.EngineException: Report engine fails
to initialize pdf emitter, please make sure required libraries for this
emitter are installed.
at
org.eclipse.birt.report.engine.api.impl.EngineTask.createCon tentEmitter(EngineTask.java:1176)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:94)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:72)
at
net.mirrorimage.cc.birt.standalone.BIRTStandaloneTest.<init >(BIRTStandaloneTest.java:141)
at
net.mirrorimage.cc.birt.standalone.BIRTStandaloneTest.main(B IRTStandaloneTest.java:159)

pointing to the fact that the call to the extManager.createEmitter seems
to be coming back null in both cases could there be a configuration
issue that I am missing? Is there a good way to debug my environment?
The fact that I am getting past the loading and parsing of the
..rptdesign file -- does that imply anything about the status of my
libraries and plugins?

Thanks again for any information,
-Rich



Jason Weathersby wrote:
> Rich,
>
> Try replacing this code:
> RenderOption renderOption = new RenderOption();
> > renderOption.setOutputFormat("HTML");
> >
renderOption.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN _RENDER);
> >
> >
> > // Set the context
> > HTMLRenderContext renderContext = new HTMLRenderContext();
> > renderContext.setImageDirectory("image");
> > renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
> > //apply rendering context to the task
> > HashMap appContext = new HashMap();
> > appContext.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
> > renderContext);
> > task.setAppContext(appContext);
> >
> > renderOption.setOutputStream(System.out);
> > task.setRenderOption(renderOption);
>
> With:
> HTMLRenderOption options = New HTMLRenderOption();
options.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN_REND ER);
> options.setOutputFormat("html");
> //options.setHtmlRtLFlag(false);
> options.setEmbeddable(true);
> //options.setImageDirectory("C:\\test\\images");
>
> //PDFRenderOption options = new PDFRenderOption();
> //options.setOutputFileName("c:/temp/test.pdf");
> //options.setOutputFormat("pdf");
> task.setRenderOption(options);
>
> Do not use the RenderContext class.
>
> Jason
>
Re: Trying to use REAPI: Report engine can not create HTML emitter [message #363792 is a reply to message #363787] Tue, 08 July 2008 18:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Rich,

I assume the org.eclipse.report.engine.emitter.pdf plugin is in your
BIRT_HOME/plugins directory? Did you add all the ReportEngine/lib jars
to your classpath?

Jason

Rich Court wrote:
> First off, thank you for your time and your help.
>
> I still receive the same error even when I take out all the
> RenderContext references.
> I did try changing the code from an HTMLRenderOption to a
> PDFRenderOption using the code you provided that was commented out. In
> that case, I get a Report engine fails to initialize pdf emitter rather
> than an html emitter.
>
> With the stack trace:
> SEVERE: Report engine can not create pdf emitter.
> org.eclipse.birt.report.engine.api.EngineException: Report engine fails
> to initialize pdf emitter, please make sure required libraries for this
> emitter are installed.
> at
> org.eclipse.birt.report.engine.api.impl.EngineTask.createCon tentEmitter(EngineTask.java:1176)
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:94)
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:72)
>
> at
> net.mirrorimage.cc.birt.standalone.BIRTStandaloneTest.<init >(BIRTStandaloneTest.java:141)
>
> at
> net.mirrorimage.cc.birt.standalone.BIRTStandaloneTest.main(B IRTStandaloneTest.java:159)
>
>
> pointing to the fact that the call to the extManager.createEmitter seems
> to be coming back null in both cases could there be a configuration
> issue that I am missing? Is there a good way to debug my environment?
> The fact that I am getting past the loading and parsing of the
> .rptdesign file -- does that imply anything about the status of my
> libraries and plugins?
>
> Thanks again for any information,
> -Rich
>
>
>
> Jason Weathersby wrote:
> > Rich,
> >
> > Try replacing this code:
> > RenderOption renderOption = new RenderOption();
> > > renderOption.setOutputFormat("HTML");
> > > renderOption.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN _RENDER);
> > >
> > >
> > > // Set the context
> > > HTMLRenderContext renderContext = new HTMLRenderContext();
> > > renderContext.setImageDirectory("image");
> > > renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
> > > //apply rendering context to the task
> > > HashMap appContext = new HashMap();
> > >
> appContext.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
> > > renderContext);
> > > task.setAppContext(appContext);
> > >
> > > renderOption.setOutputStream(System.out);
> > > task.setRenderOption(renderOption);
> >
> > With:
> > HTMLRenderOption options = New HTMLRenderOption();
> options.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN_REND ER);
> > options.setOutputFormat("html");
> > //options.setHtmlRtLFlag(false);
> > options.setEmbeddable(true);
> > //options.setImageDirectory("C:\\test\\images");
> >
> > //PDFRenderOption options = new PDFRenderOption();
> > //options.setOutputFileName("c:/temp/test.pdf");
> > //options.setOutputFormat("pdf");
> > task.setRenderOption(options);
> >
> > Do not use the RenderContext class.
> >
> > Jason
> >
Re: Trying to use REAPI: Report engine can not create HTML emitter [message #363799 is a reply to message #363792] Tue, 08 July 2008 21:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Rich.Court.gmail.com

Yes, I just double checked and I do have the
org.eclipse.birt.report.engine.emitter.pdf_2.3.0.v20080606.j ar in my
ReportEngine\plugins directory. [The html library is in there also.]

I also have the ReportEngine/lib/*.jar files (21 of them) in my classpath.

I did notice a bit of a disconnect between the setting of BIRT_HOME in
the genReport.bat versus what is expected in the source code.

In the source code, one uses the setBIRTHome method on an EngineConfig
to set the home to a path including the 'ReportEngine' suffix; whereas
in the genReport.bat script it expects the directory one up from the
'ReportEngine' as its home. I assume I am correct on this, as when I
try to setBIRTHome with the 'ReportEngine' suffix in the code, I get a
'Cant startup the OSGI framework.'

I believe that the issue is with something either in the source code,
which at this point is fairly short and simple, or my eclipse
environment; as when I set a shell environment variable of BIRT_HOME to
the same location (without the ReportEngine path) and run the included
genReport.bat script on my test report, it correctly generates both
..html and .pdf output; so the issue is not with the report.

Any other suggestions as to what to look for?

Thanks again,
-Rich








Jason Weathersby wrote:
> Rich,
>
> I assume the org.eclipse.report.engine.emitter.pdf plugin is in your
> BIRT_HOME/plugins directory? Did you add all the ReportEngine/lib jars
> to your classpath?
>
> Jason
>
> Rich Court wrote:
>> First off, thank you for your time and your help.
>>
>> I still receive the same error even when I take out all the
>> RenderContext references.
>> I did try changing the code from an HTMLRenderOption to a
>> PDFRenderOption using the code you provided that was commented out.
>> In that case, I get a Report engine fails to initialize pdf emitter
>> rather than an html emitter.
>>
>> With the stack trace:
>> SEVERE: Report engine can not create pdf emitter.
>> org.eclipse.birt.report.engine.api.EngineException: Report engine
>> fails to initialize pdf emitter, please make sure required libraries
>> for this emitter are installed.
>> at
>> org.eclipse.birt.report.engine.api.impl.EngineTask.createCon tentEmitter(EngineTask.java:1176)
>>
>> at
>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:94)
>>
>> at
>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:72)
>>
>> at
>> net.mirrorimage.cc.birt.standalone.BIRTStandaloneTest.<init >(BIRTStandaloneTest.java:141)
>>
>> at
>> net.mirrorimage.cc.birt.standalone.BIRTStandaloneTest.main(B IRTStandaloneTest.java:159)
>>
>>
>> pointing to the fact that the call to the extManager.createEmitter
>> seems to be coming back null in both cases could there be a
>> configuration issue that I am missing? Is there a good way to debug
>> my environment? The fact that I am getting past the loading and
>> parsing of the .rptdesign file -- does that imply anything about the
>> status of my libraries and plugins?
>>
>> Thanks again for any information,
>> -Rich
>>
>>
>>
>> Jason Weathersby wrote:
>> > Rich,
>> >
>> > Try replacing this code:
>> > RenderOption renderOption = new RenderOption();
>> > > renderOption.setOutputFormat("HTML");
>> > >
>> renderOption.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN _RENDER);
>> > >
>> > >
>> > > // Set the context
>> > > HTMLRenderContext renderContext = new HTMLRenderContext();
>> > > renderContext.setImageDirectory("image");
>> > > renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
>> > > //apply rendering context to the task
>> > > HashMap appContext = new HashMap();
>> > >
>> appContext.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
>> > > renderContext);
>> > > task.setAppContext(appContext);
>> > >
>> > > renderOption.setOutputStream(System.out);
>> > > task.setRenderOption(renderOption);
>> >
>> > With:
>> > HTMLRenderOption options = New HTMLRenderOption();
>> options.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN_REND ER);
>> > options.setOutputFormat("html");
>> > //options.setHtmlRtLFlag(false);
>> > options.setEmbeddable(true);
>> > //options.setImageDirectory("C:\\test\\images");
>> >
>> > //PDFRenderOption options = new PDFRenderOption();
>> > //options.setOutputFileName("c:/temp/test.pdf");
>> > //options.setOutputFormat("pdf");
>> > task.setRenderOption(options);
>> >
>> > Do not use the RenderContext class.
>> >
>> > Jason
>> >
Re: Trying to use REAPI: Report engine can not create HTML emitter [message #363837 is a reply to message #363799] Wed, 09 July 2008 15:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Rich,

If you set the log level to FINEST, are you getting a more detailed
error in the log file?

Jason

Rich Court wrote:
> Yes, I just double checked and I do have the
> org.eclipse.birt.report.engine.emitter.pdf_2.3.0.v20080606.j ar in my
> ReportEngine\plugins directory. [The html library is in there also.]
>
> I also have the ReportEngine/lib/*.jar files (21 of them) in my classpath.
>
> I did notice a bit of a disconnect between the setting of BIRT_HOME in
> the genReport.bat versus what is expected in the source code.
>
> In the source code, one uses the setBIRTHome method on an EngineConfig
> to set the home to a path including the 'ReportEngine' suffix; whereas
> in the genReport.bat script it expects the directory one up from the
> 'ReportEngine' as its home. I assume I am correct on this, as when I
> try to setBIRTHome with the 'ReportEngine' suffix in the code, I get a
> 'Cant startup the OSGI framework.'
>
> I believe that the issue is with something either in the source code,
> which at this point is fairly short and simple, or my eclipse
> environment; as when I set a shell environment variable of BIRT_HOME to
> the same location (without the ReportEngine path) and run the included
> genReport.bat script on my test report, it correctly generates both
> .html and .pdf output; so the issue is not with the report.
>
> Any other suggestions as to what to look for?
>
> Thanks again,
> -Rich
>
>
>
>
>
>
>
>
> Jason Weathersby wrote:
>> Rich,
>>
>> I assume the org.eclipse.report.engine.emitter.pdf plugin is in your
>> BIRT_HOME/plugins directory? Did you add all the ReportEngine/lib
>> jars to your classpath?
>>
>> Jason
>>
>> Rich Court wrote:
>>> First off, thank you for your time and your help.
>>>
>>> I still receive the same error even when I take out all the
>>> RenderContext references.
>>> I did try changing the code from an HTMLRenderOption to a
>>> PDFRenderOption using the code you provided that was commented out.
>>> In that case, I get a Report engine fails to initialize pdf emitter
>>> rather than an html emitter.
>>>
>>> With the stack trace:
>>> SEVERE: Report engine can not create pdf emitter.
>>> org.eclipse.birt.report.engine.api.EngineException: Report engine
>>> fails to initialize pdf emitter, please make sure required libraries
>>> for this emitter are installed.
>>> at
>>> org.eclipse.birt.report.engine.api.impl.EngineTask.createCon tentEmitter(EngineTask.java:1176)
>>>
>>> at
>>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:94)
>>>
>>> at
>>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:72)
>>>
>>> at
>>> net.mirrorimage.cc.birt.standalone.BIRTStandaloneTest.<init >(BIRTStandaloneTest.java:141)
>>>
>>> at
>>> net.mirrorimage.cc.birt.standalone.BIRTStandaloneTest.main(B IRTStandaloneTest.java:159)
>>>
>>>
>>> pointing to the fact that the call to the extManager.createEmitter
>>> seems to be coming back null in both cases could there be a
>>> configuration issue that I am missing? Is there a good way to debug
>>> my environment? The fact that I am getting past the loading and
>>> parsing of the .rptdesign file -- does that imply anything about the
>>> status of my libraries and plugins?
>>>
>>> Thanks again for any information,
>>> -Rich
>>>
>>>
>>>
>>> Jason Weathersby wrote:
>>> > Rich,
>>> >
>>> > Try replacing this code:
>>> > RenderOption renderOption = new RenderOption();
>>> > > renderOption.setOutputFormat("HTML");
>>> > >
>>> renderOption.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN _RENDER);
>>> > >
>>> > >
>>> > > // Set the context
>>> > > HTMLRenderContext renderContext = new HTMLRenderContext();
>>> > > renderContext.setImageDirectory("image");
>>> > > renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
>>> > > //apply rendering context to the task
>>> > > HashMap appContext = new HashMap();
>>> > >
>>> appContext.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
>>> > > renderContext);
>>> > > task.setAppContext(appContext);
>>> > >
>>> > > renderOption.setOutputStream(System.out);
>>> > > task.setRenderOption(renderOption);
>>> >
>>> > With:
>>> > HTMLRenderOption options = New HTMLRenderOption();
>>> options.setOutputFileName(this.OUTPUT_FILE_LOCATION_RUN_REND ER);
>>> > options.setOutputFormat("html");
>>> > //options.setHtmlRtLFlag(false);
>>> > options.setEmbeddable(true);
>>> > //options.setImageDirectory("C:\\test\\images");
>>> >
>>> > //PDFRenderOption options = new PDFRenderOption();
>>> > //options.setOutputFileName("c:/temp/test.pdf");
>>> > //options.setOutputFormat("pdf");
>>> > task.setRenderOption(options);
>>> >
>>> > Do not use the RenderContext class.
>>> >
>>> > Jason
>>> >
Re: Trying to use REAPI: Report engine can not create HTML emitter [message #367026 is a reply to message #363837] Sat, 14 February 2009 18:08 Go to previous message
Justin Hay is currently offline Justin HayFriend
Messages: 2
Registered: July 2009
Junior Member
Hello Rich,

Did you ever resolve this issue? I'm encountering the same error message.

Thanks.
Previous Topic:problem joining parameterized data sets
Next Topic:Problem with Chart
Goto Forum:
  


Current Time: Tue Mar 19 03:56:54 GMT 2024

Powered by FUDForum. Page generated in 0.02293 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top