Home » Archived » BIRT » Reports in Web page using PHP
|
Re: Reports in Web page using PHP [message #148060 is a reply to message #148050] |
Sun, 26 March 2006 17:38 |
Eclipse User |
|
|
|
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 |
Jose Meireles 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 |
Eclipse User |
|
|
|
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 #148393 is a reply to message #148088] |
Mon, 27 March 2006 11:24 |
Eclipse User |
|
|
|
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 #148852 is a reply to message #148393] |
Tue, 28 March 2006 12:28 |
Jose Meireles 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 |
Eclipse User |
|
|
|
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
|
|
|
Goto Forum:
Current Time: Mon Nov 11 09:54:58 GMT 2024
Powered by FUDForum. Page generated in 0.21032 seconds
|