|
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
>
|