|
| Re: ScriptedDatasource report [message #542697 is a reply to message #542553] |
Fri, 25 June 2010 12:17   |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
If you have the jar in the scriptlib dir you do not have to attach it.
In the designer you can also set the project classpath in the
preferences to add a Java project to your BIRT cp, but when deployed the
jar will need to be in the scriptlib dir as set in the web.xml. If you
want to attach the jar, import it to the resource folder and then select
the report and the resource tab is in the properties view. Make sure
you have the root node(report name) in the outline view selected.
Jason
On 6/25/2010 6:23 AM, ronald wrote:
> Hi all,
>
> I just downloaded Helios and installed BIRT 2.6 via the update site. It
> al seems to work very smooth; congrats!
> I don't have the java SDK installed as my project is written in PHP
> unfortunately. Do I need the java SDK also?
>
> I'm exploring BIRT and I need to create a report based on some JSON
> data. AFAIK, for JSON + BIRT you need a JSONParser as in the famous
> example on http://www.birt-exchange.org/org/devshare/designing-birt-rep
> orts/1053-scripted-data-source-using-json/#description
>
> I downloaded the source, refactored the example to a nice maven project
> and now I'm trying to attach the resulting jar as a resource to the
> report. I can't find the resource properties tab however...
>
> As I understand, I can add an external jar and use the java code in that
> jar when I import the right packages, can't I?
>
> On the dataset, open event, I have:
>
> importPackage(Packages.com.actuate.json);
> count = 0;
> controller = new Packages.com.actuate.json.JSONParser();
> controller.loadData(params["JSONURL"]);
> totalCount = controller.getChildCount("rows");
>
> Which results in the error:
>
> ReportDesign (id = 1):
> + There are errors evaluating script
> "importPackage(Packages.com.actuate.json);
> count = 0;
> controller = new Packages.com.actuate.json.JSONParser();
> controller.loadData(params["JSONURL"]);
> totalCount = controller.getChildCount("rows");
> ":
> {1}.
>
> Actually, it breaks on the 3rd line: controller = new
> Packages.com.actuate.json.JSONParser();
>
> Any help or links to the right documentation are appreciated :)
> Ronaldo
>
>
Jason Weathersby
BIRT Exchange
|
|
|
|
|
|
| Re: ScriptedDatasource report [message #545591 is a reply to message #543795] |
Thu, 08 July 2010 06:52   |
ronald Missing name Messages: 48 Registered: July 2009 |
Member |
|
|
Hi,
For two days I've been trying to build a decent spring (3) app around the report engine.
I've seen some nice future solutions (See http://jira.springframework.org/browse/SPR-1220), but they don't provide a solution for now.
Most other links use older versions of BIRT, and I did not succeed in building something nice.
So, we're using the backup plan: call the shell script to generate a pdf. And again, I'm not sure where to put the external jar (Where's the scriptlib directory located when running birt from the command line?)
The sample report works just fine, indicating that the BIRT_HOME var is set:
./genReport.sh -m runrender -f PDF -o testpdf.pdf -e UTF-8 samples/hello_world.rptdesign
Here's my directory layout:
~/birt_runtime_2.6.0/ReportEngine/
configuration/
genReport.sh
lib/
plugins/
samples/
workspace/
So I created a scriptlib in the ~/birt_runtime_2.6.0/ReportEngine/ and added this scriptlib dir to the classpath set in genReport.sh:
~/birt_runtime_2.6.0/ReportEngine/
configuration/
genReport.sh
lib/
plugins/
scriptlib/
my-jar-with-dependencies.jar
samples/
workspace/
And the genReport.sh now contains:
export BIRTCLASSPATH="$BIRT_HOME/ReportEngine/scriptlib :$BIRT_HOME/ReportEngine/lib/chartengineapi.jar:$BIRT_HOME/R eportEngine/lib/chart.....
Still, when running the command line script from within the ~/birt_runtime_2.6.0/ReportEngine/ directory, I get all sorts of errors that indicat that the my-jar-with-dependencies.jar is not correctly loaded.
(The same my-jar-with-dependencies.jar added to the classpath in the designer as indicated above works just fine from withing the designer)
I also tried to copy the org.eclipse.birt.report.viewer_2.6.0. v20100605/birt/scriptlib from within eclipse to the ~/birt_runtime_2.6.0/plugins directory... Didn't help.
So, what should I do?
TIA
Ronald
[Updated on: Thu, 08 July 2010 08:04] Report message to a moderator
|
|
|
| Re: ScriptedDatasource report [message #545608 is a reply to message #545591] |
Thu, 08 July 2010 08:22  |
ronald Missing name Messages: 48 Registered: July 2009 |
Member |
|
|
Dudes, I need more coffee...
Change the genReport.sh to contain
export BIRTCLASSPATH="$BIRT_HOME/ReportEngine/scriptlib/my-jar-with-dependencies.jar:$BIRT_HOME/ReportEngine/lib/chartengineapi.jar:.....
And explicitely name the jar you wan to include. That works.
Ronald
|
|
|
Powered by
FUDForum. Page generated in 0.02182 seconds