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)
Specifying BIRT Resource Path Programatically
phancox
We have a Java application that uses Crystal Reports for its reporting engine and are planning on migrating to BIRT. The first report ported to BIRT is running fine both from within the Eclipse IDE and from the application. Now we are looking to move some of the common functionality to a .rptlibrary.<br />
<br />
Initially we created a "resources" subdirectory under the directory where our reports are stored and specified the location in the "Report Design -> Resource" preferences "Resource folder". This all worked fine in the BIRT designer, however, when the application attempted to run the report it failed with:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>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 "Common.rptlibrary" is not found.)
</pre>
Tried setting the resources path as follows but didn't make any difference:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>_oEngineConfig = new EngineConfig();
_oEngineConfig.setEngineHome(strBirtHome);
_oEngineConfig.setResourcePath(strResourcePath);
_oEngineConfig.setTempDir(strBirtTmpFolder);
</pre>
<br />
Is this the correct way to specify the resources path ???<br />
<br />
I can make it work without setting a resource path if the library is in the same directory as the report.<br />
<br />
Any pointers on how to specify the resources path would be much appreciated.
Find more posts tagged with
Comments
mwilliams
Are you using the full path or a relative URL to define the location?
If using the birt viewer, you can set the BIRT_RESOURCE_PATH property in the web.xml.
phancox
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="75079" data-time="1301322499" data-date="28 March 2011 - 07:28 AM"><p>
Are you using the full path or a relative URL to define the location?<br />
<br />
If using the birt viewer, you can set the BIRT_RESOURCE_PATH property in the web.xml.<br /></p></blockquote>
Definitely tried with absolute path and it didn't work. Not sure if I tried a relative path, will attempt that today.<br />
<br />
Currently not using the BIRT viewer. Java application is launching the engine to render directly to PDF and viewing via whatever PDF viewer is currently installed on the client machine. We're migrating away from a Crystal Reports based solution where we use the Crystal viewer for viewing reports so I'm interested in using the BIRT viewer in a similar manner. Can you point me at some example code for launching the BIRT viewer <span class='bbc_underline'>from a Java application</span>?<br />
<br />
THANKS
mwilliams
You can call the BIRT viewer by URL from anywhere. You can also embed the viewer in a JSP page and call that page from your application.
phancox
The application runs on the client's PC so resources may be limited and end-user skill set is low. Is the only way to run the BIRT viewer via servlet engine such as Tomcat? With Crystal viewer I think we just call the code directly. We do optionally run an embedded Jetty instance so we may use that to host the BIRT viewer when we get the rest of the framework going.
mwilliams
No, you can use the viewer in your application similarly to how the designer does. It doesn't have to be deployed.
http://www.birt-exchange.org/org/devshare/designing-birt-reports/889-rcp-app-with-birt-and-scripted-datasource/