|
From: Edgar P. <pi...@ca...> - 2006-07-18 19:19:29
|
It's a shame i can't put it work.
I've been trying for a week putting rlib to work.
My last attempt was:
- Compile rlib with: --disable-perl --prefix=/usr
- make
- make install
The php file report:
--------------------------
dl ("rlib.so");
$format = "pdf";
$sql_host = "localhost";
$sql_users = "user";
$sql_password = "password";
$sql_database = "database";
$rlib = rlib_init();
echo "1";
echo rlib_version();
rlib_add_datasource_mysql($rlib, "local_mysql", $sql_host, $sql_users,
$sql_password, $sql_dabatase);
echo "2";
echo rlib_add_datasource_mysql($rlib, "local_mysql", $sql_host, $sql_users,
$sql_password, $sql_dabatase);
rlib_add_query_as($rlib, "local_mysql", "select * from ckbancos",
"ckbancos");
echo "3";
rlib_add_report($rlib, "reck_ckbancos.xml");
echo "4";
rlib_set_output_format_from_text($rlib, $format);
echo rlib_get_content_type($rlib);
rlib_execute($rlib);
rlib_spool($rlib);
rlib_free($rlib);
In the screen appear:
12034UNKNOWN
No error messages, just only a blank screen.
Any help, i will appreciate it
Edgar Picado
Messenger: edg...@ho...
Costa Rica
|
|
From: Michiel B. <mi...@be...> - 2006-07-18 23:33:37
|
Edgar,
rlib_spool($rlib) does just what it says... it spools the pdf to the
output. Problem is you are adding the string '1234' before the pdf
header and that makes the output illegal.
Try something like this, it works for me:
function maak_rapport($sql, $xml, $format, $data)
{
global $DBHOST;
dl("rlib.so");
$rlib=rlib_init();
rlib_set_locale($rlib, "nl_NL");
rlib_add_datasource_mysql($rlib, "mysql", $DBHOST, "user",
"pass", "database");
rlib_add_query_as($rlib, "mysql", $sql, "q");
rlib_add_datasource_array($rlib, "local_array");
rlib_add_query_as($rlib, "local_array", "data", "extra");
rlib_add_report($rlib,$xml);
rlib_set_output_encoding($rlib, 'utf-8');
rlib_set_output_format_from_text($rlib, $format);
rlib_execute($rlib);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header(rlib_get_content_type($rlib));
rlib_spool($rlib);
rlib_free($rlib);
}
Michiel
Edgar Picado schreef:
> It's a shame i can't put it work.
> I've been trying for a week putting rlib to work.
> My last attempt was:
>
> - Compile rlib with: --disable-perl --prefix=/usr
> - make
> - make install
>
> The php file report:
> --------------------------
> dl ("rlib.so");
>
> $format = "pdf";
> $sql_host = "localhost";
> $sql_users = "user";
> $sql_password = "password";
> $sql_database = "database";
>
> $rlib = rlib_init();
>
> echo "1";
> echo rlib_version();
> rlib_add_datasource_mysql($rlib, "local_mysql", $sql_host, $sql_users,
> $sql_password, $sql_dabatase);
> echo "2";
> echo rlib_add_datasource_mysql($rlib, "local_mysql", $sql_host,
> $sql_users, $sql_password, $sql_dabatase);
> rlib_add_query_as($rlib, "local_mysql", "select * from ckbancos",
> "ckbancos");
> echo "3";
> rlib_add_report($rlib, "reck_ckbancos.xml");
> echo "4";
> rlib_set_output_format_from_text($rlib, $format);
> echo rlib_get_content_type($rlib);
> rlib_execute($rlib);
> rlib_spool($rlib);
> rlib_free($rlib);
> In the screen appear:
>
> 12034UNKNOWN
>
> No error messages, just only a blank screen.
>
> Any help, i will appreciate it
>
> Edgar Picado
> Messenger: edg...@ho... <mailto:edg...@ho...>
> Costa Rica
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ------------------------------------------------------------------------
>
> _______________________________________________
> Rlib-users mailing list
> Rli...@li...
> https://lists.sourceforge.net/lists/listinfo/rlib-users
>
|
|
From: Edgar P. <pi...@ca...> - 2006-07-20 20:44:45
|
Thanks Michiel and Bob for your reply,
Ok, I will start again, because nothing happens with the code that I have,
or you send me.
My new code is like the one on the example:
<?
session_start();
$_SESSION['pagina'] = "consultas";
include("../includes/valida.php");
include("../includes/conexbase.php");
$link=conectarse();
dl ("rlib.so");
$format = "html";
$sql_host = "host";
$sql_users = "user";
$sql_password = "user";
$sql_database = "database";
$rlib = rlib_init();
rlib_add_datasource_mysql($rlib, "mysql", $sql_host, $sql_users,
$sql_password, $sql_dabatase);
rlib_add_query_as($rlib, "mysql", "select * from ckbancos", "ckbancos");
rlib_add_report($rlib, "reck_ckbancos.xml");
rlib_set_output_format_from_text($rlib, $format);
rlib_set_output_parameter($this->_rlib, "debugging", "yes");
rlib_execute($rlib);
header( rlib_get_content_type($rlib));
rlib_spool($rlib);
rlib_free($rlib);
?>
AND give me the following errors:
Warning: rlib_set_output_parameter() expects parameter 1 to be resource,
null given in /var/www/html/cheques/cons_ckctas.php on line 23
Warning: Cannot modify header information - headers already sent by (output
started at /var/www/html/cheques/cons_ckctas.php:23) in
/var/www/html/cheques/cons_ckctas.php on line 25
Just only that information appears!
Thanks !
Edgar Picado
|
|
From: Bob D. <bd...@si...> - 2006-07-20 21:02:31
|
Hi,
Change
rlib_set_output_parameter($this->_rlib, "debugging", "yes");
To
rlib_set_output_parameter($rlib, "debugging", "yes");
- Bob
On Thu, 2006-07-20 at 14:44 -0600, Edgar Picado wrote:
> Thanks Michiel and Bob for your reply,
>
> Ok, I will start again, because nothing happens with the code that I have,
> or you send me.
>
> My new code is like the one on the example:
>
> <?
> session_start();
> $_SESSION['pagina'] = "consultas";
> include("../includes/valida.php");
>
> include("../includes/conexbase.php");
> $link=conectarse();
>
> dl ("rlib.so");
>
> $format = "html";
> $sql_host = "host";
> $sql_users = "user";
> $sql_password = "user";
> $sql_database = "database";
>
> $rlib = rlib_init();
>
> rlib_add_datasource_mysql($rlib, "mysql", $sql_host, $sql_users,
> $sql_password, $sql_dabatase);
> rlib_add_query_as($rlib, "mysql", "select * from ckbancos", "ckbancos");
> rlib_add_report($rlib, "reck_ckbancos.xml");
> rlib_set_output_format_from_text($rlib, $format);
> rlib_set_output_parameter($this->_rlib, "debugging", "yes");
> rlib_execute($rlib);
> header( rlib_get_content_type($rlib));
> rlib_spool($rlib);
> rlib_free($rlib);
>
> ?>
>
> AND give me the following errors:
>
> Warning: rlib_set_output_parameter() expects parameter 1 to be resource,
> null given in /var/www/html/cheques/cons_ckctas.php on line 23
>
> Warning: Cannot modify header information - headers already sent by (output
> started at /var/www/html/cheques/cons_ckctas.php:23) in
> /var/www/html/cheques/cons_ckctas.php on line 25
>
> Just only that information appears!
>
> Thanks !
>
> Edgar Picado
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Rlib-users mailing list
> Rli...@li...
> https://lists.sourceforge.net/lists/listinfo/rlib-users
--
|
|
From: Edgar P. <pi...@ca...> - 2006-07-20 22:02:43
|
Hi Mr. Bob..
Ok, good, give me some errors:
RLIB: xmlParseError
RLIB: Failed to load a report file [reck_ckbancos.xml]
RLIB: Content type code unknown
Warning: Cannot modify header information - headers already sent by =
(output
started at /var/www/html/cheques/cons_ckctas.php:24) in
/var/www/html/cheques/cons_ckctas.php on line 25
-Edgar Picado
-------------------------------------------------------------------------=
---
------
Hi,
Change
rlib_set_output_parameter($this->_rlib, "debugging", "yes");
To
rlib_set_output_parameter($rlib, "debugging", "yes");
- Bob
On Thu, 2006-07-20 at 14:44 -0600, Edgar Picado wrote:
> Thanks Michiel and Bob for your reply,
>=20
> Ok, I will start again, because nothing happens with the code that I=20
> have, or you send me.
>=20
> My new code is like the one on the example:
>=20
> <?
> session_start();
> $_SESSION['pagina'] =3D "consultas";
> include("../includes/valida.php");
>=20
> include("../includes/conexbase.php");
> $link=3Dconectarse();
>=20
> dl ("rlib.so");
> =20
> $format =3D "html";
> $sql_host =3D "host";
> $sql_users =3D "user";
> $sql_password =3D "user";
> $sql_database =3D "database";
> =20
> $rlib =3D rlib_init();
> =20
> rlib_add_datasource_mysql($rlib, "mysql", $sql_host, $sql_users,=20
> $sql_password, $sql_dabatase); rlib_add_query_as($rlib, "mysql",=20
> "select * from ckbancos", "ckbancos"); rlib_add_report($rlib,=20
> "reck_ckbancos.xml"); rlib_set_output_format_from_text($rlib,=20
> $format); rlib_set_output_parameter($this->_rlib, "debugging",=20
> "yes"); rlib_execute($rlib);
> header( rlib_get_content_type($rlib));
> rlib_spool($rlib);
> rlib_free($rlib);
>=20
> ?>
>=20
> AND give me the following errors:
>=20
> Warning: rlib_set_output_parameter() expects parameter 1 to be=20
> resource, null given in /var/www/html/cheques/cons_ckctas.php on line=20
> 23
>=20
> Warning: Cannot modify header information - headers already sent by=20
> (output started at /var/www/html/cheques/cons_ckctas.php:23) in=20
> /var/www/html/cheques/cons_ckctas.php on line 25
>=20
> Just only that information appears!
>=20
> Thanks !
>=20
> Edgar Picado
|
|
From: Bob D. <bd...@si...> - 2006-07-21 01:01:11
|
So either RLIB can't load the file reck_ckbancos.xml or your have
invalid XML. Try xmllint reck_ckbancos.xml to see if it is valid XML.
Also make sure your XML file is in the same directory as your php file.
- bob
On Thu, 2006-07-20 at 16:02 -0600, Edgar Picado wrote:
> Hi Mr. Bob..
>
> Ok, good, give me some errors:
>
> RLIB: xmlParseError
>
> RLIB: Failed to load a report file [reck_ckbancos.xml]
>
> RLIB: Content type code unknown
>
> Warning: Cannot modify header information - headers already sent by (output
> started at /var/www/html/cheques/cons_ckctas.php:24) in
> /var/www/html/cheques/cons_ckctas.php on line 25
>
>
> -Edgar Picado
>
> ----------------------------------------------------------------------------
> ------
> Hi,
>
> Change
> rlib_set_output_parameter($this->_rlib, "debugging", "yes");
> To
> rlib_set_output_parameter($rlib, "debugging", "yes");
>
> - Bob
>
> On Thu, 2006-07-20 at 14:44 -0600, Edgar Picado wrote:
> > Thanks Michiel and Bob for your reply,
> >
> > Ok, I will start again, because nothing happens with the code that I
> > have, or you send me.
> >
> > My new code is like the one on the example:
> >
> > <?
> > session_start();
> > $_SESSION['pagina'] = "consultas";
> > include("../includes/valida.php");
> >
> > include("../includes/conexbase.php");
> > $link=conectarse();
> >
> > dl ("rlib.so");
> >
> > $format = "html";
> > $sql_host = "host";
> > $sql_users = "user";
> > $sql_password = "user";
> > $sql_database = "database";
> >
> > $rlib = rlib_init();
> >
> > rlib_add_datasource_mysql($rlib, "mysql", $sql_host, $sql_users,
> > $sql_password, $sql_dabatase); rlib_add_query_as($rlib, "mysql",
> > "select * from ckbancos", "ckbancos"); rlib_add_report($rlib,
> > "reck_ckbancos.xml"); rlib_set_output_format_from_text($rlib,
> > $format); rlib_set_output_parameter($this->_rlib, "debugging",
> > "yes"); rlib_execute($rlib);
> > header( rlib_get_content_type($rlib));
> > rlib_spool($rlib);
> > rlib_free($rlib);
> >
> > ?>
> >
> > AND give me the following errors:
> >
> > Warning: rlib_set_output_parameter() expects parameter 1 to be
> > resource, null given in /var/www/html/cheques/cons_ckctas.php on line
> > 23
> >
> > Warning: Cannot modify header information - headers already sent by
> > (output started at /var/www/html/cheques/cons_ckctas.php:23) in
> > /var/www/html/cheques/cons_ckctas.php on line 25
> >
> > Just only that information appears!
> >
> > Thanks !
> >
> > Edgar Picado
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Rlib-users mailing list
> Rli...@li...
> https://lists.sourceforge.net/lists/listinfo/rlib-users
|
|
From: Edgar P. <pi...@ca...> - 2006-07-21 18:22:13
|
Hi, Well.... Now I have it working....
There you have:
***** ENCABEZADO DE REPORTE *****
Encabezado de Pagina (Reporte de Ejemplo)
ID Nombre =20
1 Banco Nacional de Costa Rica =20
2 Banco de Costa Rica =20
3 Banex =20
4 BAC San Jos=E9 =20
PIE DE LA PAGINA
Pagina: 1
Now I will try to do more things, like printing the page...etc
Thanks in advance
Edgar Picado
|
|
From: Bob D. <bd...@si...> - 2006-07-19 00:03:58
|
Hi,
You need to call execute before you can call the get_content_type.
Also if you want debug messages do this before the execute:
rlib_set_output_parameter($this->_rlib, 'debugging', 'yes');
And have your format be "html"
It can also be helpful to run the RLIB from the command line to get
debugging.
- Bob
On Tue, 2006-07-18 at 13:19 -0600, Edgar Picado wrote:
> It's a shame i can't put it work.
> I've been trying for a week putting rlib to work.
> My last attempt was:
>
> - Compile rlib with: --disable-perl --prefix=/usr
> - make
> - make install
>
> The php file report:
> --------------------------
> dl ("rlib.so");
>
> $format = "pdf";
> $sql_host = "localhost";
> $sql_users = "user";
> $sql_password = "password";
> $sql_database = "database";
>
> $rlib = rlib_init();
>
> echo "1";
> echo rlib_version();
> rlib_add_datasource_mysql($rlib, "local_mysql", $sql_host, $sql_users,
> $sql_password, $sql_dabatase);
> echo "2";
> echo rlib_add_datasource_mysql($rlib, "local_mysql", $sql_host,
> $sql_users, $sql_password, $sql_dabatase);
> rlib_add_query_as($rlib, "local_mysql", "select * from ckbancos",
> "ckbancos");
> echo "3";
> rlib_add_report($rlib, "reck_ckbancos.xml");
> echo "4";
> rlib_set_output_format_from_text($rlib, $format);
> echo rlib_get_content_type($rlib);
> rlib_execute($rlib);
> rlib_spool($rlib);
> rlib_free($rlib);
>
> In the screen appear:
>
> 12034UNKNOWN
>
> No error messages, just only a blank screen.
>
> Any help, i will appreciate it
>
> Edgar Picado
> Messenger: edg...@ho...
> Costa Rica
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________ Rlib-users mailing list Rli...@li... https://lists.sourceforge.net/lists/listinfo/rlib-users
|