Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Call XLS Tribix Emitter from Php Java Bridge
Call XLS Tribix Emitter from Php Java Bridge [message #777251] Tue, 10 January 2012 06:13 Go to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason,

I have had a look at the documentation of how to call the Tribix emitter from the Report API.

I have followed the steps of placing the jar files in their respective locations.

I came across the code:

EXCELRenderOption options = new EXCELRenderOption();
options.setOutputFormat("xls");
options.setOutputFileName("output/resample/ps.xls");
options.setOption(IRenderOption.EMITTER_ID, "org.eclipse.birt.report.engine.emitter.prototype.excel");
IRenderTask task = engine.createRenderTask(document);
task.setRenderOption(options);


or


EXCELRenderOption options = new EXCELRenderOption();
options.setOutputFormat("xls");
options.setOutputFileName("output/resample/ps.xls");
options.setOption(IRenderOption.EMITTER_ID, "org.uguess.birt.report.engine.emitter.xls");
IRenderTask task = engine.createRenderTask(document);
task.setRenderOption(options);


I am wondering how to call if from my php javabridge?

For the moment I have the following code:

$taskOptions = new java("org.eclipse.birt.report.engine.api.RenderOption");
$outputStream = new java("java.io.ByteArrayOutputStream");
$taskOptions->setOutputStream($outputStream);
$taskOptions->setOutputFormat("xls");

$task->setRenderOption( $taskOptions );
$task->run();
$task->close();


Could you please inform me how pass these parameters from php?

Thanks in advance
Karvesh
Re: Call XLS Tribix Emitter from Php Java Bridge [message #777487 is a reply to message #777251] Tue, 10 January 2012 15:30 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Karvesh,

Could you try
$taskOptions->setOption("emitterID","org.uguess.birt.report.engine.emitter.xls");


Jason



On 1/10/2012 1:13 AM, karvesh Mising name wrote:
> Dear Jason,
>
> I have had a look at the documentation of how to call the Tribix emitter
> from the Report API.
>
> I have followed the steps of placing the jar files in their respective
> locations.
>
> I came across the code:
>
> EXCELRenderOption options = new EXCELRenderOption();
> options.setOutputFormat("xls");
> options.setOutputFileName("output/resample/ps.xls");
> options.setOption(IRenderOption.EMITTER_ID,
> "org.eclipse.birt.report.engine.emitter.prototype.excel");
> IRenderTask task = engine.createRenderTask(document);
> task.setRenderOption(options);
>
>
> or
>
>
> EXCELRenderOption options = new EXCELRenderOption();
> options.setOutputFormat("xls");
> options.setOutputFileName("output/resample/ps.xls");
> options.setOption(IRenderOption.EMITTER_ID,
> "org.uguess.birt.report.engine.emitter.xls");
> IRenderTask task = engine.createRenderTask(document);
> task.setRenderOption(options);
>
> I am wondering how to call if from my php javabridge?
>
> For the moment I have the following code:
>
> $taskOptions = new java("org.eclipse.birt.report.engine.api.RenderOption");
> $outputStream = new java("java.io.ByteArrayOutputStream");
> $taskOptions->setOutputStream($outputStream);
> $taskOptions->setOutputFormat("xls");
>
> $task->setRenderOption( $taskOptions );
> $task->run();
> $task->close();
>
> Could you please inform me how pass these parameters from php?
>
> Thanks in advance
> Karvesh
Re: Call XLS Tribix Emitter from Php Java Bridge [message #777940 is a reply to message #777487] Wed, 11 January 2012 07:34 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason

I tried it and i get the following error:

[o:Exception]:"java.lang.Exception: Invoke failed: [[o:RunAndRenderTask]]->run. Cause: org.eclipse.birt.report.engine.api.EngineException: EmitterID org.uguess.birt.report.engine.emitter.xls for render option is invalid. VM: 1.6.0_29@http://java.sun.com/" at:


Any clue why? Thanks

Karvesh
Re: Call XLS Tribix Emitter from Php Java Bridge [message #777947 is a reply to message #777940] Wed, 11 January 2012 07:46 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason

I tried the following:

$taskOptions->setOption("IRenderOption.EMITTER_ID","org.uguess.birt.report.engine.emitter.xls");

It does not raise any error. However the image does not come for some reason.
I followed the steps as specified in the documentation. The only difference is that I am using the versions:

org.uguess.birt.report.engine.common_2.5.2.201107181644.jar

and

org.uguess.birt.report.engine.emitter.xls_2.5.2.201107181644.jar

Do you think that this could be an issue?

Karvesh
Re: Call XLS Tribix Emitter from Php Java Bridge [message #778402 is a reply to message #777940] Wed, 11 January 2012 17:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

This is the proper approach. Where do yu have the tribix emitter
installed? What version of BIRT are you using?

Jason

On 1/11/2012 2:34 AM, karvesh Mising name wrote:
> Dear Jason
>
> I tried it and i get the following error:
>
> [o:Exception]:"java.lang.Exception: Invoke failed:
> [[o:RunAndRenderTask]]->run. Cause:
> org.eclipse.birt.report.engine.api.EngineException: EmitterID
> org.uguess.birt.report.engine.emitter.xls for render option is invalid.
> VM: 1.6.0_29@http://java.sun.com/" at:
>
>
> Any clue why? Thanks
>
> Karvesh
Re: Call XLS Tribix Emitter from Php Java Bridge [message #893341 is a reply to message #778402] Tue, 03 July 2012 15:45 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason,

I am using BIRT 3.7

I have tried it again and again but to no avail.. It just does not want to work out. Here are my steps (from: http://birtworld.blogspot.com/2011/07/replacing-default-birt-xls-emitter.html):



1.
Download tribix emitters
org.uguess.birt.report.engine.emitter.xls_2.5.2.201107181644.jar
and
org.uguess.birt.report.engine.common_2.5.2.201107181644.jar
from sourceforge

2. Extract the xls emitter file and cut from the folder the files:
xls-emitter.jar
lib\commons-jexl-1.1.jar
lib\commons-logging-1.1.1.jar
lib\poi-3.7-20101029.jar


4. Paste the four files above into WEB-INF\lib together with org.uguess.birt.report.engine.common_2.5.2.201107181644.jar

5. Zip the folder org.uguess.birt.report.engine.emitter.xls_2.5.2.201107181644 without the cut files into a jar file and copy the modified jar file into WEB-INF\lib

6. Finally call the emitter using the API from php:

$taskOptions = new java("org.eclipse.birt.report.engine.api.RenderOption");
$taskOptions->setOption("IRenderOption.EMITTER_ID","org.uguess.birt.report.engine.emitter.xls");
$outputStream = new java("java.io.ByteArrayOutputStream");
$taskOptions->setOutputStream($outputStream);
$taskOptions->setOutputFormat("xls");
$task->setRenderOption( $taskOptions );
$task->run();
$task->close();


Yet when i export the report to excel, all the data come up fine but no images still Sad
I am quite desperate about it now..

Any clue what i did wrong?

I really need some kind help here...

Regards,
Karvesh

Re: Call XLS Tribix Emitter from Php Java Bridge [message #893793 is a reply to message #893341] Thu, 05 July 2012 14:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Probably the quotes around IRenderOption.EMITTER_ID is the issue.
replace that with "emitterID", with quotes and give it a test.

Jason

On 7/3/2012 11:45 AM, karvesh Mising name wrote:
> Dear Jason,
>
> I am using BIRT 3.7
>
> I have tried it again and again but to no avail.. It just does not want
> to work out. Here are my steps (from:
> http://birtworld.blogspot.com/2011/07/replacing-default-birt-xls-emitter.html):
>
>
>
>
> 1. Download tribix emitters
> org.uguess.birt.report.engine.emitter.xls_2.5.2.201107181644.jar
> and
> org.uguess.birt.report.engine.common_2.5.2.201107181644.jar
> from sourceforge
>
> 2. Extract the xls emitter file and cut from the folder the files:
> xls-emitter.jar
> lib\commons-jexl-1.1.jar
> lib\commons-logging-1.1.1.jar
> lib\poi-3.7-20101029.jar
> 4. Paste the four files above into WEB-INF\lib together with
> org.uguess.birt.report.engine.common_2.5.2.201107181644.jar
>
> 5. Zip the folder
> org.uguess.birt.report.engine.emitter.xls_2.5.2.201107181644 without the
> cut files into a jar file and copy the modified jar file into WEB-INF\lib
>
> 6. Finally call the emitter using the API from php:
>
> $taskOptions = new java("org.eclipse.birt.report.engine.api.RenderOption");
> $taskOptions->setOption("IRenderOption.EMITTER_ID","org.uguess.birt.report.engine.emitter.xls");
>
> $outputStream = new java("java.io.ByteArrayOutputStream");
> $taskOptions->setOutputStream($outputStream);
> $taskOptions->setOutputFormat("xls");
> $task->setRenderOption( $taskOptions );
> $task->run();
> $task->close();
>
> Yet when i export the report to excel, all the data come up fine but no
> images still :(
> I am quite desperate about it now..
>
> Any clue what i did wrong?
>
> I really need some kind help here...
>
> Regards,
> Karvesh
>
Re: Call XLS Tribix Emitter from Php Java Bridge [message #986871 is a reply to message #893793] Thu, 22 November 2012 08:03 Go to previous message
Kelly Wang is currently offline Kelly WangFriend
Messages: 5
Registered: October 2012
Junior Member
Hi, I am trying to do this also. After following the steps mentioned above. Even without set :
$taskOptions->setOption("IRenderOption.EMITTER_ID","org.uguess.birt.report.engine.emitter.xls");
The chart image is included in the excel. I guess the engine use the 1st emitter found which happens to be Tribix. (mentioned in the blog post)

Besides this, there is a problem of formatting, the table formatting is not accurate comparing to the default xls emitter.

Anyone has any clue about this?

[Updated on: Thu, 22 November 2012 08:04]

Report message to a moderator

Previous Topic:Define specific tray for specific pages
Next Topic:Stacked BarChar - change one serie to Line
Goto Forum:
  


Current Time: Thu Apr 18 15:11:19 GMT 2024

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

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

Back to the top