Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Placing library in RAP environment
Placing library in RAP environment [message #782729] Tue, 24 January 2012 05:02 Go to next message
Gabor Grocz is currently offline Gabor Grocz
Messages: 6
Registered: November 2011
Junior Member
Hello everyone,

I have a stupid question. I have a report with library. It is running fine within eclipse but not in my RAP environment. How should I place the my BIRT library in a RAP environment? Now I get the following error:

2012.01.24. 9:22:11 org.eclipse.birt.report.model.core.LayoutModule loadLibrarySilently
WARNING: Syntax error found, and see error details.
Error.DesignFileException.SYNTAX_ERROR - 1 errors found!
1.) org.eclipse.birt.report.model.parser.DesignParserException (code = Error.DesignParserException.FILE_NOT_FOUND, message : The file "ri3_mysql.rptlibrary" is not found.)

at org.eclipse.birt.report.model.core.LayoutModule.loadLibrary(LayoutModule.java:378)


The design reference is the following:
<list-property name="libraries">
<structure>
<property name="fileName">ri3_mysql.rptlibrary</property>
<property name="namespace">ri3_mysql</property>
</structure>
</list-property>

But however I try to place the library file I got the same error.
Thanks,
Gábor
Re: Placing library in RAP environment [message #782835 is a reply to message #782729] Tue, 24 January 2012 09:46 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Is the library in the same folder as the report design?

Jason

On 1/24/2012 5:02 AM, Gabor Grocz wrote:
> Hello everyone,
>
> I have a stupid question. I have a report with library. It is running
> fine within eclipse but not in my RAP environment. How should I place
> the my BIRT library in a RAP environment? Now I get the following error:
>
> 2012.01.24. 9:22:11 org.eclipse.birt.report.model.core.LayoutModule
> loadLibrarySilently
> WARNING: Syntax error found, and see error details.
> Error.DesignFileException.SYNTAX_ERROR - 1 errors found! 1.)
> org.eclipse.birt.report.model.parser.DesignParserException (code =
> Error.DesignParserException.FILE_NOT_FOUND, message : The file
> "ri3_mysql.rptlibrary" is not found.)
>
> at
> org.eclipse.birt.report.model.core.LayoutModule.loadLibrary(LayoutModule.java:378)
>
>
>
> The design reference is the following:
> <list-property name="libraries">
> <structure>
> <property name="fileName">ri3_mysql.rptlibrary</property>
> <property name="namespace">ri3_mysql</property>
> </structure>
> </list-property>
>
> But however I try to place the library file I got the same error.
> Thanks,
> Gábor
>


Jason Weathersby

BIRT Exchange
Re: Placing library in RAP environment [message #782855 is a reply to message #782835] Tue, 24 January 2012 10:31 Go to previous messageGo to next message
Gabor Grocz is currently offline Gabor Grocz
Messages: 6
Registered: November 2011
Junior Member
Hi Jason,

yes there is next to the report.
Re: Placing library in RAP environment [message #782989 is a reply to message #782855] Tue, 24 January 2012 16:49 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I am not very familiar with RAP, but from the log the library is not
being located. When we deploy the BIRT Viewer we set the resource
folder in the web.xml and in the designer it is set in the preferences.
What does the directory to the report look like when deployed in RAP?


Jason

On 1/24/2012 10:31 AM, Gabor Grocz wrote:
> Hi Jason,
>
> yes there is next to the report.


Jason Weathersby

BIRT Exchange
Re: Placing library in RAP environment [message #783316 is a reply to message #782989] Wed, 25 January 2012 08:44 Go to previous messageGo to next message
Gabor Grocz is currently offline Gabor Grocz
Messages: 6
Registered: November 2011
Junior Member
Honestly our implementation doesn't use the viewer inside the app. I use the following code to insert the report:

		try {
			config = new EngineConfig();
			IReportEngineFactory factory = (IReportEngineFactory) Platform
					.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
			engine = factory.createReportEngine(config);

			URL url;
			InputStream fs = null;
			try {
				url = getReportURL();
				fs = url.openStream();
			} catch (MalformedURLException ex) {
				ex.printStackTrace();
			} catch (IOException ex) {
				ex.printStackTrace();
			}

			design = engine.openReportDesign(fs);

			// Create task to run and render the report
			task = engine.createRunAndRenderTask(design);

			// Render the report to HTML
			renderOptions = new HTMLRenderOption();
			renderOptions.setOutputFormat(HTMLRenderOption.HTML);
			renderOptions.setOutputStream(outputStream);

			task.setRenderOption(renderOptions);
			task.run();
			task.close();

			browser.setText(outputStream.toString());

			engine.destroy();

		} catch (EngineException ex) {
			ex.printStackTrace();
		}


So actually I just insert the HTML output into the swt browser. The design and the library are in the same directory and they are on the classpath. Should I set somehow the EngineConfig to find the library?
Re: Placing library in RAP environment [message #783396 is a reply to message #783316] Wed, 25 January 2012 11:30 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You could try setting the resource path in the EngineConfig.

config.setResourcePath("directoryoflibs");

Jason

On 1/25/2012 8:44 AM, Gabor Grocz wrote:
> Honestly our implementation doesn't use the viewer inside the app. I use
> the following code to insert the report:
>
>
> try {
> config = new EngineConfig();
> IReportEngineFactory factory = (IReportEngineFactory) Platform
> .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
> engine = factory.createReportEngine(config);
>
> URL url;
> InputStream fs = null;
> try {
> url = getReportURL();
> fs = url.openStream();
> } catch (MalformedURLException ex) {
> ex.printStackTrace();
> } catch (IOException ex) {
> ex.printStackTrace();
> }
>
> design = engine.openReportDesign(fs);
>
> // Create task to run and render the report
> task = engine.createRunAndRenderTask(design);
>
> // Render the report to HTML
> renderOptions = new HTMLRenderOption();
> renderOptions.setOutputFormat(HTMLRenderOption.HTML);
> renderOptions.setOutputStream(outputStream);
>
> task.setRenderOption(renderOptions);
> task.run();
> task.close();
>
> browser.setText(outputStream.toString());
>
> engine.destroy();
>
> } catch (EngineException ex) {
> ex.printStackTrace();
> }
>
>
> So actually I just insert the HTML output into the swt browser. The
> design and the library are in the same directory and they are on the
> classpath. Should I set somehow the EngineConfig to find the library?
>


Jason Weathersby

BIRT Exchange
Re: Placing library in RAP environment [message #783813 is a reply to message #783396] Thu, 26 January 2012 09:16 Go to previous messageGo to next message
Gabor Grocz is currently offline Gabor Grocz
Messages: 6
Registered: November 2011
Junior Member
Hi Jason,

thanks it is working now!
Gábor
Re: Placing library in RAP environment [message #897670 is a reply to message #783813] Wed, 25 July 2012 00:07 Go to previous message
Jay Hamilton is currently offline Jay Hamilton
Messages: 19
Registered: October 2011
Junior Member
Gabor,
I am having a similar problem. Exactly what was your configuration like and what was the path you added to the config.setResourcePath("path")method?
Previous Topic:Dynamic text with page number
Next Topic:Multiple values for dynamic parameter
Goto Forum:
  


Current Time: Sat Apr 19 03:09:33 EDT 2014

Powered by FUDForum. Page generated in 0.02972 seconds