Problem with Birt Viewer 3.7.1 using Scripted data source [message #855153] |
Tue, 24 April 2012 11:10  |
Eclipse User |
|
|
|
Hi,
I've created 2 separated projects: the first is a Java project that generates the report (rptdesign file) and the second is a dynamic web project based on JSF 2.0 which shows the report generated by the first project using jsp viewer taglib.
In the first project I used a scripted data source and here is my open script:
dataSetHandle.setOpen( "i = 0;\r\n"
+"Pack1 = new Packages.calculMetrics.performanceMetrics.DataSet();\r\n"
+"L = Pack1.getLabels();\r\n"
+"V = Pack1.extractData(L);\r\n"
+"Pack2 = new Packages.calculMetrics.performanceMetrics.OpenedW2D();\r\n"
+"Pack2.openedw2d(V);\r\n"
+"Pack3 = new Packages.calculMetrics.performanceMetrics.ClosedW10d();\r\n"
+"Pack3.closedw10d(V);"
Where L is a list of Strings and V is a vector of classes
When I run my report in the Eclipse viewer I get no problems, same thing if I run it from a report Engine (using HTMLRenderOption()) I get the HTML report with no problem
but when I run it in Birt Viewer from the other project I get a strange error:
Script engine error: ReferenceError: "V" is not defined.
I attached below the stack trace.
Here is what I've done exactly in the web project:
- I created a dynamic web project v2.5
- I deployed Birt Viewer 3.7.1 in a GlassFish server v 3.1.2
- I copied the generated rptdesign file in the root directory of the viewer (D:\glassfish3\glassfish\domains\domain1\applications\birt)
- I copied some libs (SQL Server, Hibernate, ...) into the lib directory
- I copied the jar file of the first project in the scriptlib directory
- I tested the viewer using this jsp page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http ://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http: //java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http: //java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<html>
<f:view>
<body>
<birt:report id="birtViewer" reportDesign="PMetrics.rptdesign" baseURL="/birt"
height="600"
width="800"
format="html"
isHostPage="false"
reportContainer="iframe"
>
</birt:report>
</body>
</f:view>
</html>
I tested it with other sample reports and it worked perfectly
Environment:
- Eclipse BIRT 3.7.1 (all in one)
- BIRT runtime 3.7.1
- JDK 1.7
- GlassFish Server 3.1.2
- JSF 2.0
- Hibernate Tools 3.4.0
I can't understand why have I to define the vector V in the Javascript code of the second project however it works perfectly in the first one without definition.
Can anyone help me to solve this problem ???
|
|
|
|
|
Re: Problem with Birt Viewer 3.7.1 using Scripted data source [message #856365 is a reply to message #855323] |
Wed, 25 April 2012 11:41   |
Eclipse User |
|
|
|
Claude,
As a test could you jar the hibernate config file by itself manually and
drop it in the web-inf/lib directory?
Jason
On 4/24/2012 2:12 PM, Claude B wrote:
> Hi Jason,
> Thank you for your quick response,
> First I want to answer your question, I tried this code and the result was:
> Pack1 mailto:calculMetrics.performanceMetrics.DataSet@1778087
>
> but while doing this I realized that I ignored an important part of the log file, I'm so sorry I thought it was relative to an old execution, I attached the full log this time and I discovered that the problem is due to Hibernate, it can't find the hibernate.cfg.xml file so the extractData() method couldn't be executed and the vector is not created.
>
> But I'm still confused because I've the hibernate.cfg.xml file in the root dir of my jar file and I can't understand why it can't find it. BTW I'm creating my jar file using Ant and here is the jar tag:
>
> <target name="jar" depends="compile">
> <mkdir dir="${jar.dir}"/>
> <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
> <manifest>
> <attribute name="Main-Class" value="${exec_report-class}"/>
> </manifest>
> <fileset dir="src" />
> </jar>
> </target>
>
>
> As you can see I added "<fileset dir="src" />" so that I can export my configuration and mapping xml files, the hibernate.cfg.xml file is in the src directory of the first project.
>
> Any idea please!!!
|
|
|
|
|
Re: Problem with Birt Viewer 3.7.1 using Scripted data source [message #857586 is a reply to message #856470] |
Thu, 26 April 2012 13:22  |
Eclipse User |
|
|
|
Claude this will really depend on what functions you want available to
the user. For example If you do not want to support flat file data
sources you could remove:
org.eclipse.datatools.connectivity.oda.flatfile_version.jar
Jason
On 4/25/2012 1:42 PM, Claude B wrote:
> Jason, I have another question,
> Now I'm going to integrate this web project into another web project
> which contains many other libs so I want to reduce the number of libs of
> the web viewer project. At first, I added all libs that I found in the
> web-inf/lib of the viewer to my project WebContent/web-inf/lib (84 libs)
> and now I want to delete unused libs: So can you tell me what are the
> necessary libs that I need to run the viewer???
|
|
|
Powered by
FUDForum. Page generated in 0.05107 seconds