Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Reports in Web page using PHP
Reports in Web page using PHP [message #148050] Sun, 26 March 2006 14:25 Go to next message
Jose Meireles is currently offline Jose MeirelesFriend
Messages: 8
Registered: July 2009
Junior Member
Hi everyone,

I'm trying to produce reports using a web page using PHP, for now I'm
running the first example found in the BIRT site
(http://www.eclipse.org/birt/phoenix/deploy/usingPHP.php). But it simple
don't run. I tried in IIS and now in Apache 2. PHP runs in my Apache 2
web server.
Does anyone have a link to a page with more detailed info or a simple
running example?

My code and the message I receive is is found bellow

Any help will be very appreciated

Thanks in advance

Jose

Message:
Warning: Cannot modify header information - headers already sent by
(output started at C:\Program Files\Apache
Group\Apache2\htdocs\PHPApache\testBirt.php:3) in C:\Program
Files\Apache Group\Apache2\htdocs\PHPApache\testBirt.php on line 8

Source Code:

<html>
<head>
<?
$fname = "c:/temp/test.rptdesign";
// Redirect browser
$dest = "http://localhost:8080/birt-viewer/run?__report=";
$dest .= urlencode( realpath( $fname ) );
header("Location: $dest" );
?>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>
Re: Reports in Web page using PHP [message #148060 is a reply to message #148050] Sun, 26 March 2006 17:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: service.altekweb.com

Hello José,

Looks like you all ready sent the html header info. Try this without the
html tags.

<?php
$fname = "new_report.rptdesign";
$paramValue = "pdf";
$dest = "http://localhost:8180/birt/run?__report=";
$dest .= urlencode( $fname );
$dest .= "&__format=" . urlencode( $paramValue );
$dest .= "&p_host=localhost";
$dest .= "&p_db=conetstaff.com";
header("Location: $dest" );
?>

A better way is to use CURL that way you can hide the url info.

<?php
$fname = "new_report.rptdesign";
$paramValue = "pdf";
$dest = "http://localhost:8180/birt/run?__report=";
$dest .= urlencode( $fname );
$dest .= "&__format=" . urlencode( $paramValue );

$ch = curl_init($dest);
if (! $ch) {
die( "Cannot allocate a new PHP-CURL handle" );
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);

$data = curl_exec($ch);
curl_close($ch);
header("Content-type: application/pdf");
print($data);
?>

I got the code to use CURL from a reportman user group on yahoo.


Bo



José Meireles wrote:
> Hi everyone,
>
> I'm trying to produce reports using a web page using PHP, for now I'm
> running the first example found in the BIRT site
> (http://www.eclipse.org/birt/phoenix/deploy/usingPHP.php). But it simple
> don't run. I tried in IIS and now in Apache 2. PHP runs in my Apache 2
> web server.
> Does anyone have a link to a page with more detailed info or a simple
> running example?
>
> My code and the message I receive is is found bellow
>
> Any help will be very appreciated
>
> Thanks in advance
>
> Jose
>
> Message:
> Warning: Cannot modify header information - headers already sent by
> (output started at C:\Program Files\Apache
> Group\Apache2\htdocs\PHPApache\testBirt.php:3) in C:\Program
> Files\Apache Group\Apache2\htdocs\PHPApache\testBirt.php on line 8
>
> Source Code:
>
> <html>
> <head>
> <?
> $fname = "c:/temp/test.rptdesign";
> // Redirect browser
> $dest = "http://localhost:8080/birt-viewer/run?__report=";
> $dest .= urlencode( realpath( $fname ) );
> header("Location: $dest" );
> ?>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
> <body>
> </body>
> </html>
Re: Reports in Web page using PHP [message #148070 is a reply to message #148060] Mon, 27 March 2006 01:15 Go to previous messageGo to next message
Jose Meireles is currently offline Jose MeirelesFriend
Messages: 8
Registered: July 2009
Junior Member
I appreciate your help Bo.

I think I'm missing something here. After removing the html tags like
you suggested I still have errors in my web browser.
Now the error is :
<<
The page cannot be found
The page you are looking for might have been removed, had its name
changed, or is temporarily unavailable.

------------------------------------------------------------ --------------------
>>
etc...

Thing's look better though :)

I have PHP 5 installed and I know it's running through my apache 2 web
server.

Any suggestions?

Bo Ugljesic wrote:
> Hello José,
>
> Looks like you all ready sent the html header info. Try this without the
> html tags.
>
> <?php
> $fname = "new_report.rptdesign";
> $paramValue = "pdf";
> $dest = "http://localhost:8180/birt/run?__report=";
> $dest .= urlencode( $fname );
> $dest .= "&__format=" . urlencode( $paramValue );
> $dest .= "&p_host=localhost";
> $dest .= "&p_db=conetstaff.com";
> header("Location: $dest" );
> ?>
>
> A better way is to use CURL that way you can hide the url info.
>
> <?php
> $fname = "new_report.rptdesign";
> $paramValue = "pdf";
> $dest = "http://localhost:8180/birt/run?__report=";
> $dest .= urlencode( $fname );
> $dest .= "&__format=" . urlencode( $paramValue );
>
> $ch = curl_init($dest);
> if (! $ch) {
> die( "Cannot allocate a new PHP-CURL handle" );
> }
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
>
> $data = curl_exec($ch);
> curl_close($ch);
> header("Content-type: application/pdf");
> print($data);
> ?>
>
> I got the code to use CURL from a reportman user group on yahoo.
>
>
> Bo
>
>
>
> José Meireles wrote:
>> Hi everyone,
>>
>> I'm trying to produce reports using a web page using PHP, for now I'm
>> running the first example found in the BIRT site
>> (http://www.eclipse.org/birt/phoenix/deploy/usingPHP.php). But it
>> simple don't run. I tried in IIS and now in Apache 2. PHP runs in my
>> Apache 2 web server.
>> Does anyone have a link to a page with more detailed info or a simple
>> running example?
>>
>> My code and the message I receive is is found bellow
>>
>> Any help will be very appreciated
>>
>> Thanks in advance
>>
>> Jose
>>
>> Message:
>> Warning: Cannot modify header information - headers already sent by
>> (output started at C:\Program Files\Apache
>> Group\Apache2\htdocs\PHPApache\testBirt.php:3) in C:\Program
>> Files\Apache Group\Apache2\htdocs\PHPApache\testBirt.php on line 8
>>
>> Source Code:
>>
>> <html>
>> <head>
>> <?
>> $fname = "c:/temp/test.rptdesign";
>> // Redirect browser
>> $dest = "http://localhost:8080/birt-viewer/run?__report=";
>> $dest .= urlencode( realpath( $fname ) );
>> header("Location: $dest" );
>> ?>
>> <title>Untitled Document</title>
>> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
>> </head>
>> <body>
>> </body>
>> </html>
Re: Reports in Web page using PHP [message #148073 is a reply to message #148070] Mon, 27 March 2006 01:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: service.altekweb.com

make sure you change the code for the location and port of your tomcat
server

$dest = "http://localhost:8180/birt/run?__report=";



José Meireles wrote:
> I appreciate your help Bo.
>
> I think I'm missing something here. After removing the html tags like
> you suggested I still have errors in my web browser.
> Now the error is :
> <<
> The page cannot be found
> The page you are looking for might have been removed, had its name
> changed, or is temporarily unavailable.
>
> ------------------------------------------------------------ --------------------
>
> >>
> etc...
>
> Thing's look better though :)
>
> I have PHP 5 installed and I know it's running through my apache 2 web
> server.
>
> Any suggestions?
Re: Reports in Web page using PHP [message #148088 is a reply to message #148073] Mon, 27 March 2006 09:28 Go to previous messageGo to next message
Jose Meireles is currently offline Jose MeirelesFriend
Messages: 8
Registered: July 2009
Junior Member
I did it, the problem might be that I have Apache 2installed instead of
Apache Tomcat... Is it possible?

Bo Ugljesic wrote:
> make sure you change the code for the location and port of your tomcat
> server
>
> $dest = "http://localhost:8180/birt/run?__report=";
>
>
>
> José Meireles wrote:
>> I appreciate your help Bo.
>>
>> I think I'm missing something here. After removing the html tags like
>> you suggested I still have errors in my web browser.
>> Now the error is :
>> <<
>> The page cannot be found
>> The page you are looking for might have been removed, had its name
>> changed, or is temporarily unavailable.
>>
>> ------------------------------------------------------------ --------------------
>>
>> >>
>> etc...
>>
>> Thing's look better though :)
>>
>> I have PHP 5 installed and I know it's running through my apache 2 web
>> server.
>>
>> Any suggestions?
>
Re: Reports in Web page using PHP [message #148393 is a reply to message #148088] Mon, 27 March 2006 11:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: service.altekweb.com

Hello José,

To deploy the reports in a production environment you will need a java
app server, like tomcat, jboss etc...

http://www.eclipse.org/birt/phoenix/build/#j2ee
http://www.eclipse.org/birt/phoenix/deploy/viewerSetup.php

Bo


José Meireles wrote:
> I did it, the problem might be that I have Apache 2installed instead of
> Apache Tomcat... Is it possible?
>
> Bo Ugljesic wrote:
>> make sure you change the code for the location and port of your tomcat
>> server
>>
>> $dest = "http://localhost:8180/birt/run?__report=";
>>
>>
>>
>> José Meireles wrote:
>>> I appreciate your help Bo.
>>>
>>> I think I'm missing something here. After removing the html tags like
>>> you suggested I still have errors in my web browser.
>>> Now the error is :
>>> <<
>>> The page cannot be found
>>> The page you are looking for might have been removed, had its name
>>> changed, or is temporarily unavailable.
>>>
>>> ------------------------------------------------------------ --------------------
>>>
>>> >>
>>> etc...
>>>
>>> Thing's look better though :)
>>>
>>> I have PHP 5 installed and I know it's running through my apache 2
>>> web server.
>>>
>>> Any suggestions?
>>
Re: Reports in Web page using PHP [message #148725 is a reply to message #148393] Mon, 27 March 2006 22:31 Go to previous messageGo to next message
Jose Meireles is currently offline Jose MeirelesFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Bo,

I guess that's what is missing here. I have JBOSS, but I suppose It's
not running...

Thanks for the links. I'll work on this

Jose

Bo Ugljesic wrote:
> Hello José,
>
> To deploy the reports in a production environment you will need a java
> app server, like tomcat, jboss etc...
>
> http://www.eclipse.org/birt/phoenix/build/#j2ee
> http://www.eclipse.org/birt/phoenix/deploy/viewerSetup.php
>
> Bo
>
>
> José Meireles wrote:
>> I did it, the problem might be that I have Apache 2installed instead
>> of Apache Tomcat... Is it possible?
>>
>> Bo Ugljesic wrote:
>>> make sure you change the code for the location and port of your
>>> tomcat server
>>>
>>> $dest = "http://localhost:8180/birt/run?__report=";
>>>
>>>
>>>
>>> José Meireles wrote:
>>>> I appreciate your help Bo.
>>>>
>>>> I think I'm missing something here. After removing the html tags
>>>> like you suggested I still have errors in my web browser.
>>>> Now the error is :
>>>> <<
>>>> The page cannot be found
>>>> The page you are looking for might have been removed, had its name
>>>> changed, or is temporarily unavailable.
>>>>
>>>> ------------------------------------------------------------ --------------------
>>>>
>>>> >>
>>>> etc...
>>>>
>>>> Thing's look better though :)
>>>>
>>>> I have PHP 5 installed and I know it's running through my apache 2
>>>> web server.
>>>>
>>>> Any suggestions?
>>>
Re: Reports in Web page using PHP [message #148755 is a reply to message #148725] Tue, 28 March 2006 02:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Just wanted to point you to a posting I did on EclipseZone

http://www.eclipsezone.com/eclipse/forums/t52981.html

We are working on an Integration with Zend's Java Bridge technology and
It is going very well. Hopefully we can release more details on this soon.

Jason Weathersby
BIRT PMC





"Jos
Re: Reports in Web page using PHP [message #148844 is a reply to message #148755] Tue, 28 March 2006 12:21 Go to previous messageGo to next message
Jose Meireles is currently offline Jose MeirelesFriend
Messages: 8
Registered: July 2009
Junior Member
Thanks for your comment.

It's seems very interesting the work of looking for a more rich
integration between PHP and BIRT.
Since PHP is able to read Java classes I believe it's a potential choice
to integrate tools like hibernate in reports viewed in a web environment.


Jason Weathersby wrote:
> Just wanted to point you to a posting I did on EclipseZone
>
> http://www.eclipsezone.com/eclipse/forums/t52981.html
>
> We are working on an Integration with Zend's Java Bridge technology and
> It is going very well. Hopefully we can release more details on this soon.
>
> Jason Weathersby
> BIRT PMC
>
>
>
>
>
> "José Meireles" <jmeireles@objectconnection.net> wrote in message
> news:e09p3d$l0l$1@utils.eclipse.org...
>> Hi Bo,
>>
>> I guess that's what is missing here. I have JBOSS, but I suppose It's
>> not running...
>>
>> Thanks for the links. I'll work on this
>>
>> Jose
>>
>> Bo Ugljesic wrote:
>>> Hello José,
>>>
>>> To deploy the reports in a production environment you will need a java
>>> app server, like tomcat, jboss etc...
>>>
>>> http://www.eclipse.org/birt/phoenix/build/#j2ee
>>> http://www.eclipse.org/birt/phoenix/deploy/viewerSetup.php
>>>
>>> Bo
>>>
>>>
>>> José Meireles wrote:
>>>> I did it, the problem might be that I have Apache 2installed instead of
>>>> Apache Tomcat... Is it possible?
>>>>
>>>> Bo Ugljesic wrote:
>>>>> make sure you change the code for the location and port of your tomcat
>>>>> server
>>>>>
>>>>> $dest = "http://localhost:8180/birt/run?__report=";
>>>>>
>>>>>
>>>>>
>>>>> José Meireles wrote:
>>>>>> I appreciate your help Bo.
>>>>>>
>>>>>> I think I'm missing something here. After removing the html tags like
>>>>>> you suggested I still have errors in my web browser.
>>>>>> Now the error is :
>>>>>> <<
>>>>>> The page cannot be found
>>>>>> The page you are looking for might have been removed, had its name
>>>>>> changed, or is temporarily unavailable.
>>>>>>
>>>>>> ------------------------------------------------------------ --------------------
>>>>>>
>>>>>> >>
>>>>>> etc...
>>>>>>
>>>>>> Thing's look better though :)
>>>>>>
>>>>>> I have PHP 5 installed and I know it's running through my apache 2 web
>>>>>> server.
>>>>>>
>>>>>> Any suggestions?
>
>
Re: Reports in Web page using PHP [message #148852 is a reply to message #148393] Tue, 28 March 2006 12:28 Go to previous messageGo to next message
Jose Meireles is currently offline Jose MeirelesFriend
Messages: 8
Registered: July 2009
Junior Member
Hello Bo,

Just installed, configured and started Tomcat. I believe everything is
ok now. I hava web server (apache2) a app server (Tomcat), my PHP is
configured to work with apache (and php files run ok), all is set to
port 8080, but when I run my code there are still errors:

after my testBirt.php redirect the output to:

http://localhost:8080/birt-viewer/run?__report=c%3A%5Ctemp%5 Ctest.rptdesign

it says:

The page cannot be found
The page you are looking for might have been removed, had its name
changed, or is temporarily unavailable.
....

Something is wrong, no doubt about that... but what? any hints?

Thank you for you concern


Jose


Bo Ugljesic wrote:
> Hello José,
>
> To deploy the reports in a production environment you will need a java
> app server, like tomcat, jboss etc...
>
> http://www.eclipse.org/birt/phoenix/build/#j2ee
> http://www.eclipse.org/birt/phoenix/deploy/viewerSetup.php
>
> Bo
>
>
> José Meireles wrote:
>> I did it, the problem might be that I have Apache 2installed instead
>> of Apache Tomcat... Is it possible?
>>
>> Bo Ugljesic wrote:
>>> make sure you change the code for the location and port of your
>>> tomcat server
>>>
>>> $dest = "http://localhost:8180/birt/run?__report=";
>>>
>>>
>>>
>>> José Meireles wrote:
>>>> I appreciate your help Bo.
>>>>
>>>> I think I'm missing something here. After removing the html tags
>>>> like you suggested I still have errors in my web browser.
>>>> Now the error is :
>>>> <<
>>>> The page cannot be found
>>>> The page you are looking for might have been removed, had its name
>>>> changed, or is temporarily unavailable.
>>>>
>>>> ------------------------------------------------------------ --------------------
>>>>
>>>> >>
>>>> etc...
>>>>
>>>> Thing's look better though :)
>>>>
>>>> I have PHP 5 installed and I know it's running through my apache 2
>>>> web server.
>>>>
>>>> Any suggestions?
>>>
Re: Reports in Web page using PHP [message #149032 is a reply to message #148852] Tue, 28 March 2006 16:07 Go to previous message
Eclipse UserFriend
Originally posted by: service.altekweb.com

Hello José,

Try http://localhost:8080 , this should get the tomcat console.

From there you can go to manager console and view the birt application.
Click on it and try to run report.

Tomcat has nothing to do with your apache2 server it is a seperate
server that runs on a different port.

Bo


José Meireles wrote:
> Hello Bo,
>
> Just installed, configured and started Tomcat. I believe everything is
> ok now. I hava web server (apache2) a app server (Tomcat), my PHP is
> configured to work with apache (and php files run ok), all is set to
> port 8080, but when I run my code there are still errors:
>
> after my testBirt.php redirect the output to:
>
> http://localhost:8080/birt-viewer/run?__report=c%3A%5Ctemp%5 Ctest.rptdesign
>
> it says:
>
> The page cannot be found
> The page you are looking for might have been removed, had its name
> changed, or is temporarily unavailable.
> ...
>
> Something is wrong, no doubt about that... but what? any hints?
>
> Thank you for you concern
>
>
> Jose
Previous Topic:Using Two Data Sources in a Chart
Next Topic:So sad to say ...
Goto Forum:
  


Current Time: Mon Nov 11 09:54:58 GMT 2024

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

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

Back to the top