Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » BIRT + JavaBridge Tutorial(Configuring BIRT with JavaBridge)
BIRT + JavaBridge Tutorial [message #647002] Mon, 03 January 2011 17:38 Go to next message
osuwariboy Mising name is currently offline osuwariboy Mising name
Messages: 18
Registered: December 2010
Junior Member
Hello everyone,

Well, first of all I apologize if I'm not posting this in the right place but I really had no idea where else to post it. Anyway, the thing is that I had a lot of difficulty setting up BIRT to work correctly with JavaBridge.

Since I could not find any clear tutorial on how to do this, I decided to create my own, which I posted on youtube. Here are the links for whoever is interested:

http://www.youtube.com/watch?v=79aXbyx52kY
http://www.youtube.com/watch?v=fb5iSBrw6O4

Also, and this is mainly why I've created this post, in my video, I'm giving credit to Jason Weathersby who helped me set things right once and for all. Should this pause any sort of problem with you then just say the word and I shall remove the videos immediately.

Thanks a lot everyone and have a good viewing Wink.

Osu
Re: BIRT + JavaBridge Tutorial [message #647098 is a reply to message #647002] Tue, 04 January 2011 10:30 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Osu,

Great tutorial and thanks for putting it together. It would be great if
you could create a link to it in the birt exchange devshare.

Jason

On 1/3/2011 5:38 PM, osuwariboy wrote:
> Hello everyone,
>
> Well, first of all I apologize if I'm not posting this in the right
> place but I really had no idea where else to post it. Anyway, the thing
> is that I had a lot of difficulty setting up BIRT to work correctly with
> JavaBridge.
> Since I could not find any clear tutorial on how to do this, I decided
> to create my own, which I posted on youtube. Here are the links for
> whoever is interested:
>
> http://www.youtube.com/watch?v=79aXbyx52kY
> http://www.youtube.com/watch?v=fb5iSBrw6O4
>
> Also, and this is mainly why I've created this post, in my video, I'm
> giving credit to Jason Weathersby who helped me set things right once
> and for all. Should this pause any sort of problem with you then just
> say the word and I shall remove the videos immediately.
>
> Thanks a lot everyone and have a good viewing ;).
>
> Osu
Re: BIRT + JavaBridge Tutorial [message #647131 is a reply to message #647002] Tue, 04 January 2011 12:09 Go to previous messageGo to next message
osuwariboy Mising name is currently offline osuwariboy Mising name
Messages: 18
Registered: December 2010
Junior Member
Hey Jason,

Thanks for the suggestion, I've done just that and posted the link in the BIRT exchange "Deploying and Integrating BIRT Report Engine in Applications" section (I hope that's the place you had in mind when you mentioned the BIRT exchange devshare if not well, just point me in the right direction Wink ).

I sincerely hope some people will find it useful and also, feel free to give the link to the videos to whoever you feel might need it.

Thanks again for your assistance Smile.

Osu

P.S. Did I get your name right? English not being my mother language, I sometimes have tiny bits of pronounciation problems Wink
Re: BIRT + JavaBridge Tutorial [message #647137 is a reply to message #647002] Tue, 04 January 2011 12:49 Go to previous messageGo to next message
osuwariboy Mising name is currently offline osuwariboy Mising name
Messages: 18
Registered: December 2010
Junior Member
Okay, I've posted my article at the right place this time... but you get an error 404 when you try to access it. I've contacted the webmaster to see what went wrong. That's really too bad Sad
Re: BIRT + JavaBridge Tutorial [message #647143 is a reply to message #647131] Tue, 04 January 2011 12:46 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Osu,

Where you posted it is perfect. BTW you did pronounce my name correctly.

Thanks again

Jason

On 1/4/2011 12:09 PM, osuwariboy wrote:
> Hey Jason,
>
> Thanks for the suggestion, I've done just that and posted the link in
> the BIRT exchange "Deploying and Integrating BIRT Report Engine in
> Applications" section (I hope that's the place you had in mind when you
> mentioned the BIRT exchange devshare if not well, just point me in the
> right direction ;) ).
>
> I sincerely hope some people will find it useful and also, feel free to
> give the link to the videos to whoever you feel might need it.
>
> Thanks again for your assistance :).
>
> Osu
>
> P.S. Did I get your name right? English not being my mother language, I
> sometimes have tiny bits of pronounciation problems ;)
Re: BIRT + JavaBridge Tutorial [message #647145 is a reply to message #647137] Tue, 04 January 2011 12:56 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ok, the webmaster should be able to get it fixed.

Jason


On 1/4/2011 12:49 PM, osuwariboy wrote:
> Okay, I've posted my article at the right place this time... but you get
> an error 404 when you try to access it. I've contacted the webmaster to
> see what went wrong. That's really too bad :(
Re: BIRT + JavaBridge Tutorial [message #647160 is a reply to message #647002] Tue, 04 January 2011 14:44 Go to previous messageGo to next message
osuwariboy Mising name is currently offline osuwariboy Mising name
Messages: 18
Registered: December 2010
Junior Member
Okay, I figured out what was wrong with the link... it was because I put the caracter "+" in my post title. Once removed, everything worked properly.
Re: BIRT + JavaBridge Tutorial [message #648216 is a reply to message #647160] Tue, 11 January 2011 15:15 Go to previous messageGo to next message
Eclipse User
Originally posted by: Holger.Buchner.Googlemail.com

Am 04.01.2011 20:44, schrieb osuwariboy:
> Okay, I figured out what was wrong with the link... it was because I put
> the caracter "+" in my post title. Once removed, everything worked
> properly.
Dear osuwariboy,
very interesting recording. Thanks for putting that together.
your,
Holger
Re: BIRT + JavaBridge Tutorial [message #704975 is a reply to message #648216] Fri, 29 July 2011 05:33 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason and Osu

I have been watching the video
I found the part where the birt engine in the Java Bridge has to be updated really interesting.
You mention the need to:
- rename the lib and plugin folders in the birt java bridge folder and append old to them
- copy the newer folder versions of lib and plugin from birt runtime 2.6.1 to the equivalent folders in the java bridge one

My little problem starts here.. I have Birt Runtime 3.7.0 and in there is only one folder, namely Lib in the ReportEngine folder. So what do i do in that context??

Please help me here.. I have been dying to get BIRT work with PHP.. Your video and this thread have been really brilliant and helpful...
Thanking you in advance..
Re: BIRT + JavaBridge Tutorial [message #705238 is a reply to message #704975] Fri, 29 July 2011 11:42 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
I downloaded the Birt Engine 2.6.1 eventually
Its working! awesome!
Thanks a lot..

As you said: "it was not easy to know but once you know its easy" Smile
Re: BIRT + JavaBridge Tutorial [message #705259 is a reply to message #705238] Fri, 29 July 2011 12:08 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Karvesh,

I will try to upgrade the integration to 3.7 next week. BIRT 3.7 is a
POJO runtime and does not use OSGi so it will be different.

Jason

On 7/29/2011 11:42 AM, karvesh wrote:
> I downloaded the Birt Engine 2.6.1 eventually
> Its working! awesome!
> Thanks a lot..
> As you said: "it was not easy to know but once you know its easy" :)
Re: BIRT + JavaBridge Tutorial [message #705311 is a reply to message #705259] Fri, 29 July 2011 13:29 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Karvesh,

I went ahead and tried to run the php java bridge with BIRT 3.7. It
works fine. So I updated this page to show what I did to get it to work
with BIRT 3.7:
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/743-calling-birt-from-php/

Look in the writeup for the upgrade instructions for BIRT 3.7.

Jason

On 7/29/2011 12:08 PM, Jason Weathersby wrote:
> Karvesh,
>
> I will try to upgrade the integration to 3.7 next week. BIRT 3.7 is a
> POJO runtime and does not use OSGi so it will be different.
>
> Jason
>
> On 7/29/2011 11:42 AM, karvesh wrote:
>> I downloaded the Birt Engine 2.6.1 eventually
>> Its working! awesome!
>> Thanks a lot..
>> As you said: "it was not easy to know but once you know its easy" :)
>
Re: BIRT + JavaBridge Tutorial [message #705709 is a reply to message #705311] Sat, 30 July 2011 03:59 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

Thanks a lot for the reply. I will try it eventually with the version 3.7.
I have one question for the moment. It concerns the file report.php in the JavaBridge folder.

When I open the file, i see that there is a code:
$myReport = "test.rptdesign";

This means that the test report file will be rendered. That is fine. My question may sound naive, but even if i change the code to say:
$myReport = "MyNewReport.rptdesign";

the browser still renders the test.rptdesign report, unless i rename MyNewReport.rptdesign to test.rptdesign within the folder itself.. Is it because the file has been compiled somewhere and it cannot be modified?

In fact, I am asking this question because i now want to plug in the codes in my php web app and call different reports at will..

Could you please hint me here Jason?

Thanking you in advance..

Re: BIRT + JavaBridge Tutorial [message #705711 is a reply to message #647137] Sat, 30 July 2011 04:01 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Osu,

I would first of all like to thank you for these videos! They were brilliant and EXTREMELY helpful..

I have one question for the moment. It concerns the file report.php in the JavaBridge folder.

When I open the file, i see that there is a code:
$myReport = "test.rptdesign";

This means that the test report file will be rendered. That is fine. My question may sound naive, but even if i change the code to say:
$myReport = "MyNewReport.rptdesign";

the browser still renders the test.rptdesign report, unless i rename MyNewReport.rptdesign to test.rptdesign within the folder itself.. Is it because the file has been compiled somewhere and it cannot be modified?

In fact, I am asking this question because i now want to plug in the codes in my php web app and call different reports at will..

Could you please hint me here?

Thanking you in advance..
Re: BIRT + JavaBridge Tutorial [message #707332 is a reply to message #705709] Mon, 01 August 2011 10:09 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Karvesh,

You should see 12 php files related to running BIRT reports.
For example PhpRunAndRenderPDF.php

In that example we get the current location like:
$here = getcwd();

and then open a specific report
$report =
$birtReportEngine->openReportDesign("${here}/TopNPercent.rptdesign");

Jason

On 7/30/2011 3:59 AM, karvesh wrote:
> Dear Jason
>
> Thanks a lot for the reply. I will try it eventually with the version 3.7.
> I have one question for the moment. It concerns the file report.php in
> the JavaBridge folder.
> When I open the file, i see that there is a code:
> $myReport = "test.rptdesign";
>
> This means that the test report file will be rendered. That is fine. My
> question may sound naive, but even if i change the code to say:
> $myReport = "MyNewReport.rptdesign";
>
> the browser still renders the test.rptdesign report, unless i rename
> MyNewReport.rptdesign to test.rptdesign within the folder itself.. Is it
> because the file has been compiled somewhere and it cannot be modified?
>
> In fact, I am asking this question because i now want to plug in the
> codes in my php web app and call different reports at will..
>
> Could you please hint me here Jason?
>
> Thanking you in advance..
>
>
Re: BIRT + JavaBridge Tutorial [message #707352 is a reply to message #707332] Mon, 01 August 2011 10:44 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

Thanks for the reply.
Its ok. Once I got it hosted on my apache web server, it is working all fine.
The BIRT engine has successfully been integrated with my current php application.
It is now possible to view reports within an iframe generated with parameters passed from within the php code itself.
Also i notice it is much faster that using the classic BIRT viewer..

Since there is no frameset similar to the classic BIRT Viewer, i had to write JScript code to handle the export to php, xls, doc and page by page navigation.
I had to create the rptdocument file first and then call the function below to skip to pages

$task->setPageRange("$pageToGo-$pageToGo")

I noticed one thing though: each time i start my Tomcat server and i call a report for the first time, i get a time out.
Also, occassionally, when i run reports after reports intensively for testing, i get a bug report within my iframe:

Fatal error: protocol error: ,Invalid document end at col 94. Check the back end log for OutOfMemoryErrors. in C:\wamp\www\RSSB\BIRT\JavaBridge\java\Java.inc on line 869

I have to restart tomcat and it gets back to normal. Any clue why?

Nevertheless, i am immensely grateful to you and your team. Integrating a powerful reporting engine with php has been a real challenge and its worderful that its now available. Thanks a lot Jason.

I am still testing on Birt 2.6.2. Once i got all the reports done I will switch back to the 3.7 version.

Thanks in advance
Karvesh

Re: BIRT + JavaBridge Tutorial [message #707369 is a reply to message #707352] Mon, 01 August 2011 10:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

On tomcat make sure you have the jvm parameter -XX:MaxPermSize=256M is
set. I set mine in the catalina.bat file. When BIRT first starts up it
takes a some time to startup the platform. This is probably the issue
on the first report. BIRT 3.7 should be much quicker on startup time.

Jason

On 8/1/2011 10:44 AM, karvesh wrote:
> Dear Jason
>
> Thanks for the reply.
> Its ok. Once I got it hosted on my apache web server, it is working all
> fine.
> The BIRT engine has successfully been integrated with my current php
> application.
> It is now possible to view reports within an iframe generated with
> parameters passed from within the php code itself. Also i notice it is
> much faster that using the classic BIRT viewer..
>
> Since there is no frameset similar to the classic BIRT Viewer, i had to
> write JScript code to handle the export to php, xls, doc and page by
> page navigation.
> I had to create the rptdocument file first and then call the function
> below to skip to pages
>
> $task->setPageRange("$pageToGo-$pageToGo")
>
> I noticed one thing though: each time i start my Tomcat server and i
> call a report for the first time, i get a time out. Also, occassionally,
> when i run reports after reports intensively for testing, i get a bug
> report within my iframe:
>
> Fatal error: protocol error: ,Invalid document end at col 94. Check the
> back end log for OutOfMemoryErrors. in
> C:\wamp\www\RSSB\BIRT\JavaBridge\java\Java.inc on line 869
>
> I have to restart tomcat and it gets back to normal. Any clue why?
>
> Nevertheless, i am immensely grateful to you and your team. Integrating
> a powerful reporting engine with php has been a real challenge and its
> worderful that its now available. Thanks a lot Jason.
>
> I am still testing on Birt 2.6.2. Once i got all the reports done I will
> switch back to the 3.7 version.
>
> Thanks in advance
> Karvesh
>
>
Re: BIRT + JavaBridge Tutorial [message #707371 is a reply to message #707369] Mon, 01 August 2011 11:08 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
No Message Body
Re: BIRT + JavaBridge Tutorial [message #707372 is a reply to message #707371] Mon, 01 August 2011 11:09 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

I will try the -XX:MaxPermSize=256M and check that the OutOfMemoryErrors does not happen again. Thanks

Karvesh
Re: BIRT + JavaBridge Tutorial [message #707378 is a reply to message #707372] Mon, 01 August 2011 11:20 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

I have tried at least 100 times with all reports and parameters. It is all stable and solid. The out of memory issue seems resolved now.
Great!
During the week i will attempt to switch to the 3.7 version.

Just one question, the folders sessionChartImages and reportDocuments where files are created according to the session of the application, I guess I will need to create a batch file that automatically cleans them from time to time...

Thanks..

Karvesh
Re: BIRT + JavaBridge Tutorial [message #707385 is a reply to message #707378] Mon, 01 August 2011 11:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

That is correct.

On 8/1/2011 11:20 AM, karvesh wrote:
> Dear Jason
>
> I have tried at least 100 times with all reports and parameters. It is
> all stable and solid. The out of memory issue seems resolved now.
> Great!
> During the week i will attempt to switch to the 3.7 version.
> Just one question, the folders sessionChartImages and reportDocuments
> where files are created according to the session of the application, I
> guess I will need to create a batch file that automatically cleans them
> from time to time...
>
> Thanks..
>
> Karvesh
Re: BIRT + JavaBridge Tutorial [message #710935 is a reply to message #707385] Fri, 05 August 2011 11:38 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

I have a question regarding the export data functionality. In the web viewer, there is an export data option where we can export the data from the dataset element whilst specifying the data type of the column too.

Is there a similar function in the php bridge as well?

Thanking you in advance

Karvesh
Re: BIRT + JavaBridge Tutorial [message #713587 is a reply to message #710935] Mon, 08 August 2011 11:56 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Karvesh,

You could always call the data extract api yourself. Here is an example
with very little error checking.


<?php

define ("JAVA_HOSTS", "127.0.0.1:8080");
define ("JAVA_SERVLET", "/JavaBridge/JavaBridge.phpjavabridge");
$pth = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
$path_parts = pathinfo($pth);
require_once("java/Java.inc");

session_start();

$here = getcwd();

$ctx = java_context()->getServletContext();
$birtReportEngine =
java("org.eclipse.birt.php.birtengine.BirtEngine")->getBirtEngine($ctx);
java_context()->onShutdown(java("org.eclipse.birt.php.birtengine.BirtEngine")->getShutdownHook());


try{

$document = $birtReportEngine->openReportDocument($here .
"/reportDocuments/" . session_id() . "/mytopnreportdocument.rptdocument");
$task = $birtReportEngine->createDataExtractionTask($document);
$task->selectResultSet( "NewChart" );
$iExtractResults = $task->extract();

$iData = $iExtractResults->nextResultIterator( );
while ($chk = $iData->next()) {
if( $chk->toString() == "false" ){
break;
}
echo "<br/>";
echo $iData->getValue(1) . " " . $iData->getValue(0);
}
$iData->close();

$document->close();
$task->close();

} catch (JavaException $e) {
echo $e; //"Error Calling BIRT";

}

echo $outputStream;

?>

In the above case the must be a chart in the rptdocument that is named
NewChart. The above example only returns the first two columns.

Jason

On 8/5/2011 11:38 AM, karvesh wrote:
> Dear Jason
>
> I have a question regarding the export data functionality. In the web
> viewer, there is an export data option where we can export the data from
> the dataset element whilst specifying the data type of the column too.
>
> Is there a similar function in the php bridge as well?
>
> Thanking you in advance
>
> Karvesh
Re: BIRT + JavaBridge Tutorial [message #713940 is a reply to message #713587] Tue, 09 August 2011 08:53 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

you mean i actually need to create a chart in the report in order to extract the data?
Is it not possible to extract the dataset directly?

Sorry for the hassle Jason

Thanks in advance
Karvesh
Re: BIRT + JavaBridge Tutorial [message #713959 is a reply to message #713940] Tue, 09 August 2011 09:40 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Data extraction even in the BIRT viewer is always based on report items
not data sets. So if your data set is tied to a table you extract the
table and you will get the data. Naming the report item just makes this
easier.

Jason

On 8/9/2011 8:53 AM, karvesh wrote:
> Dear Jason
>
> you mean i actually need to create a chart in the report in order to
> extract the data?
> Is it not possible to extract the dataset directly?
>
> Sorry for the hassle Jason
>
> Thanks in advance
> Karvesh
Re: BIRT + JavaBridge Tutorial [message #713977 is a reply to message #713959] Tue, 09 August 2011 10:05 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

thanks for the hint. I named the table where the dataset was bound and it works all fine.
I did a little correction to the php code and i commented the line at the end:

//echo $outputStream;

Then it works ok.

Thanks again..

Karvesh
Re: BIRT + JavaBridge Tutorial [message #714000 is a reply to message #713977] Tue, 09 August 2011 10:46 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Glad to hear.

Jason

On 8/9/2011 10:05 AM, karvesh wrote:
> Dear Jason
>
> thanks for the hint. I named the table where the dataset was bound and
> it works all fine. I did a little correction to the php code and i
> commented the line at the end:
>
> //echo $outputStream;
>
> Then it works ok.
>
> Thanks again..
>
> Karvesh
Re: BIRT + JavaBridge Tutorial [message #715311 is a reply to message #714000] Sat, 13 August 2011 04:57 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

I finally managed to test the integration of BIRT Runtime 3.7 with the current Java Bridge. It is working great. And indeed, it is much faster than the BIRT Runtime 2.6. Thanks for the instructions..

Karvesh
Re: BIRT + JavaBridge Tutorial [message #715338 is a reply to message #714000] Sat, 13 August 2011 08:43 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

As mentioned before, i had to write JS + php to navigate across my reports pages and export functionality.

I have been looking at the JSAPI. It seems to be powerful and easily integrated with php according to an article written by you. I just want to know if it is open source or commercial?

I know that it comes with the evaluation version of the iServer, but nonetheless, is the JSAPI part open source?

Thanks
Karvesh
Re: BIRT + JavaBridge Tutorial [message #715779 is a reply to message #715338] Mon, 15 August 2011 10:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Karvesh,

The JSAPI is not open source. It is a commercial feature of Actuate's
iPortal package.

Jason

On 8/13/2011 8:43 AM, karvesh wrote:
> Dear Jason
>
> As mentioned before, i had to write JS + php to navigate across my
> reports pages and export functionality.
>
> I have been looking at the JSAPI. It seems to be powerful and easily
> integrated with php according to an article written by you. I just want
> to know if it is open source or commercial?
>
> I know that it comes with the evaluation version of the iServer, but
> nonetheless, is the JSAPI part open source?
>
> Thanks
> Karvesh
Re: BIRT + JavaBridge Tutorial [message #717884 is a reply to message #715779] Mon, 22 August 2011 12:03 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

I have a question regarding the path of the jar file mysql connector in the BIRT report. I was deploying the reports at the client site and when i tested the reports there i noticed that they were not connecting with the database. After some searching, i noticed in the xml view of the reports that the path to the mysql connector was set absolutely to the location of the jar file on my machine..

So what i did is that i had to rename the path so that they point to the mysql connector jar file on the client server machine. I did it in an absolute manner for the moment. I have one question here. What is the point of pasting the connector files in the lib folder of the birt viewer in the java bridge?

Could you please provide me with any hint or advise as how to set the path? Should it be relative?

Thanks in advance
Karvesh
Re: BIRT + JavaBridge Tutorial [message #717899 is a reply to message #717884] Mon, 22 August 2011 12:37 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Are you using connection profiles or just the standard JDBC driver?

Jason

On 8/22/2011 12:03 PM, karvesh wrote:
> Dear Jason
>
> I have a question regarding the path of the jar file mysql connector in
> the BIRT report. I was deploying the reports at the client site and when
> i tested the reports there i noticed that they were not connecting with
> the database. After some searching, i noticed in the xml view of the
> reports that the path to the mysql connector was set absolutely to the
> location of the jar file on my machine..
>
> So what i did is that i had to rename the path so that they point to the
> mysql connector jar file on the client server machine. I did it in an
> absolute manner for the moment. I have one question here. What is the
> point of pasting the connector files in the lib folder of the birt
> viewer in the java bridge?
>
> Could you please provide me with any hint or advise as how to set the
> path? Should it be relative?
>
> Thanks in advance
> Karvesh
Re: BIRT + JavaBridge Tutorial [message #718012 is a reply to message #717899] Mon, 22 August 2011 22:45 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
I have been using connection profiles set up from the BIRT Design Time. Yet when i ran the reports at the client site, the database connection did not seem to be made. When i changed the JDBC path in the reports xml, it all got fine.. Any clue why?

Karvesh
Re: BIRT + JavaBridge Tutorial [message #718140 is a reply to message #718012] Tue, 23 August 2011 07:39 Go to previous messageGo to next message
PTPro  is currently offline PTPro
Messages: 9
Registered: August 2011
Junior Member
Since I had to make BIRT work with PHP recently I share with you all the sequence of actions and installations I've made.

My computer had Windows XP SP3 with XAMPP installed (no Tomcat or java installed on the machine).

So I've made this:


1. Pre-requirements
1.1. Java runtime and SDK


2. Software to Install
2.1. Activate Tomcat on XAMPP. (NOTE: before starting the tomcat, set environment variable - JAVA_HOME to the java SDK directory).
2.2. Download PHP/Java bridge (At: http://php-java-bridge.sourceforge.net/pjb/download.php - version "Documentation". Paste JavaBridge.war file at <Xampp folder>\tomcat\webapps ahd check installation at http://127.0.0.1:8081/JavaBridge/
2.3. Install Commons Logging (Download at: http://commons.apache.org/logging/download_logging.cgi - Binaries, version.zip). Copy .jar files into <Xampp folder>\tomcat\webapps\birt-viewer\WEB-INF\lib\
2.4. Install BIRT Runtime (Download at: http://download.eclipse.org/birt/downloads/ where says "Latest BIRT runtime Release Build") - copy WebViewerExample folder to <Xampp Folder>\tomcat\webapps\ and rename it to Birt-Viewer.
2.5. Start Apache at XAMPP;
2.6. Start Tomcat at<Xampp Folder>, executing catalina_start.bat
2.7. Test tomcat: http://localhost:8080/ (if something saying tomcat shows, it's ok)
2.8. Test JavaBridge: http://localhost:8080/JavaBridge (if something saying javabridge shows, it's ok)


And that's it, you've got it configured and running, just create your PHP web sites and consume the reports using JavaBridge OR BIRT viewer.

If you just want to render the report, use JavaBridge. If you want to render the report and allow printing and exporting out of the box, use Birt viewer (however you must consider security since the access is http and not by file).

Hope this helps!
Re: BIRT + JavaBridge Tutorial [message #718181 is a reply to message #718140] Tue, 23 August 2011 10:15 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Thanks for the information. Its is quite a completely different approach as to what i have done. It is worth considering indeed. Thanks a lot.

Regarding the export functionality, i am making use of the export php files shipped with the javabridge.

Thanks

Karvesh
Re: BIRT + JavaBridge Tutorial [message #718202 is a reply to message #718140] Tue, 23 August 2011 10:53 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Nice writeup. In the beforeOpen script of the data source for a report
that uses connection profiles you can change the jar location or the
profile location.

For example, if you set the resource folder and place your connection
profile in the resource folder you could use a script like:

if(
!reportContext.getHttpServletRequest().getAttribute("attributeBean").isDesigner()
){
myresourcefolder = reportContext.getDesignHandle().getResourceFolder()
this.setExtensionProperty("OdaConnProfileStorePath",
myresourcefolder+"/mysqlclassic.txt");
}

If you want to change the jar location use
this.setExtensionProperty("jarList", "c:/jars/mydbjar.jar");
You could also put the jar in the resource folder and use the script
above to locate it.

In php set the resource folder like:


$here = getcwd();
$ctx = java_context()->getServletContext();
$birtReportEngine =
java("org.eclipse.birt.php.birtengine.BirtEngine")->getBirtEngine($ctx);
java_context()->onShutdown(java("org.eclipse.birt.php.birtengine.BirtEngine")->getShutdownHook());


try{
//should only be set once will affect all users of the engine
$birtReportEngine->getConfig()->setResourcePath(${here} . "/myresources" );
..
..
..

Jason

On 8/23/2011 7:39 AM, PTPro wrote:
> Since I had to make BIRT work with PHP recently I share with you all the
> sequence of actions and installations I've made.
>
> My computer had Windows XP SP3 with XAMPP installed (no Tomcat or java
> installed on the machine).
>
> So I've made this:
>
>
> 1. Pre-requirements
> 1.1. Java runtime and SDK
>
>
> 2. Software to Install
> 2.1. Activate Tomcat on XAMPP. (NOTE: before starting the tomcat, set
> environment variable - JAVA_HOME to the java SDK directory).
> 2.2. Download PHP/Java bridge (At:
> http://php-java-bridge.sourceforge.net/pjb/download.php - version
> "Documentation". Paste JavaBridge.war file at <Xampp
> folder>\tomcat\webapps ahd check installation at
> http://127.0.0.1:8081/JavaBridge/
> 2.3. Install Commons Logging (Download at:
> http://commons.apache.org/logging/download_logging.cgi - Binaries,
> version.zip). Copy .jar files into <Xampp
> folder>\tomcat\webapps\birt-viewer\WEB-INF\lib\
> 2.4. Install BIRT Runtime (Download at:
> http://download.eclipse.org/birt/downloads/ where says "Latest BIRT
> runtime Release Build") - copy WebViewerExample folder to <Xampp
> Folder>\tomcat\webapps\ and rename it to Birt-Viewer.
> 2.5. Start Apache at XAMPP;
> 2.6. Start Tomcat at<Xampp Folder>, executing catalina_start.bat
> 2.7. Test tomcat: http://localhost:8080/ (if something saying tomcat
> shows, it's ok)
> 2.8. Test JavaBridge: http://localhost:8080/JavaBridge (if something
> saying javabridge shows, it's ok)
>
>
> And that's it, you've got it configured and running, just create your
> PHP web sites and consume the reports using JavaBridge OR BIRT viewer.
>
> If you just want to render the report, use JavaBridge. If you want to
> render the report and allow printing and exporting out of the box, use
> Birt viewer (however you must consider security since the access is http
> and not by file).
>
> Hope this helps!
Re: BIRT + JavaBridge Tutorial [message #730034 is a reply to message #718202] Tue, 27 September 2011 10:24 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

I have been using BIRT integrated with php with no problem so far. For the moment, when it comes to printing, i have to export the report to pdf, download it and then send it to printer.

I was wondering if there is another way to send it for printing in one click just like in the birt report viewer?

Any help here would be the most welcomed

Thanking you in advance

Karvesh
Re: BIRT + JavaBridge Tutorial [message #735286 is a reply to message #718202] Tue, 11 October 2011 08:35 Go to previous message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Jason

I am having some problem to pass date parameters from php to birt via the javabridge.
I have declared a parameter in birt of datatype date. Then in my php code i am trying:

$task->setParameterValue("paramDtFrom", new java("java.util.Date", $DTFROM));

However, i am getting an exception error. Then i looked at the Java.inc file in the java bridge where the data types are declared and found the following piece of code:

function __call($method,$args) {
$client=$this->__client;
$sig="@{$this->__signature}@$method";
$len=count($args);
$args2=array($this->__java);
for($i=0; $i<$len; $i++) {
switch(gettype($val=$args[$i])) {
case 'boolean': array_push($args2,$val); $sig.='@b'; break;
case 'integer': array_push($args2,$val); $sig.='@i'; break;
case 'double': array_push($args2,$val); $sig.='@d'; break;
case 'string': array_push($args2,htmlspecialchars($val,ENT_COMPAT)); $sig.='@s';
break;
case 'array':$sig="~INVALID"; break;
case 'object':
if($val instanceof java_JavaType) {
array_push($args2,$val->__java);
$sig.="@o{$val->__signature}";
}
else {
$sig="~INVALID";
}
break;
case 'resource': array_push($args2,$val); $sig.='@r'; break;
case 'NULL': array_push($args2,$val); $sig.='@N'; break;
case 'unknown type': array_push($args2,$val); $sig.='@u'; break;
default: throw new java_IllegalArgumentException($val)
;
}


Does that mean that date data types cannot be passed via the javabridge?

Should i pass them as string values rather?

Thanks in advance..
Karvesh
Previous Topic:Problems with org.eclipse.datatools.connectivity.oda.OdaException; org.eclipse.core.runtime.Assert
Next Topic:PHP BIRT Integration - parameter Passing
Goto Forum:
  


Current Time: Fri Aug 01 10:00:35 EDT 2014

Powered by FUDForum. Page generated in 0.03022 seconds