how to install phpjasperxml in codeigniter


i've phpjasperxml class ( this class is convert xml(created by ireport) to fpdf.
i'm new in codeigniter,i dont know how to insert this class in codeigniter...
need help please..

..sorry for my bad english ^_^...


Have a look at user_guide/general/creating_libraries.html.

Copy to application/libraries.
Rename the file to PHPJasperXML.php.
Copy the folder fpdf to application/libraries.
Insert the following line to PHPJasperXML.php after the <?php tag:

You should now be able to load the library in your controller using

thanks it work..

Im also using the PHPJasperXML0.7a, but ive noticed that when generating the report i get lots of notices. I put the @ before the PHPJasperXML class calls and it works fine. I dont think its totally sweet to silence the errors, so anybody had corrected the PHPJasperXML class?? It has a lot of details that generates the notices.

This is my not honey moon solution:

* To change this template, choose Tools | Templates
* and open the template in the editor.
//include_once ('setting.php');


$xml =  simplexml_load_file($jasperfile);

@$PHPJasperXML = new PHPJasperXML();

@$PHPJasperXML->outpage("I");    //page output method I:standard output  D:Download file


@ is a very resource-intensive solution. Errors can and should be silenced in a production environment.

[quote author="noctrum" date="1278456476"]@ is a very resource-intensive solution. Errors can and should be silenced in a production environment.[/quote]

Thanks!, I normally like to pray and use a try-catch block for errors. I log them and propagate depending on the application layer the error occurs.

Even for the fatal errors i like to use the strategy described on this post:
what i do is also to log them, and put a not bleeding output.

Ive seen that when you use @ you do a total silence, and i want to still log for errors.

$xml = simplexml_load_file("report/chathuReport.jasper");

I have error from that, this is the error

Message: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "report/chathuReport.jasper"

What I have to do?

give it a full path to the file.

thanks CroNix, but I get this error

Message: simplexml_load_file() [function.simplexml-load-file]: report/report1.jasper:1: parser error : Start tag expected, '<' not found


  $path = site_url('report/report1.jrxml');
  //echo $path;
  //echo htmlspecialchars($path);
  $xml =  simplexml_load_file($path);
  $PHPJasperXML = new PHPJasperXML();
  $PHPJasperXML->arrayParameter=array("parameter1"=>"this isi a parameter");
  $PHPJasperXML->outpage("D");    //page output method I:standard output  D:Download file

That's my code but I got small blank pdf file without file name

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.