DEPRECATED! ΒΆ
Since this extension took too much of my time, i stopped the development, so i'm sorry to say that i almost didn't do anything more to improve it.
IMPORTANT Info: I've developed this extension in my work to help me to generate PDF Reports, if you want to help me, i appreciate!
Requirements
Yii 1.1.5 is required
Jasper Reports
What have in this extension
FDPF lib (http://www.fpdf.org/)
Xml2Pdf lib (http://www.geelweb.org)
Setup
In your protected/config/main.php config file, add the following to the file:
'import' => array(
...
'ext.JasPHP.*',
),
'components' => array(
...
'jasPHP' => array(
'class' => 'JasPHP',
),
),
That's all you have to do for setup. You can use like this. Example:
Yii::app()->jasPHP->create(getcwd() . '/reports/', 'reportName.jrxml', array('parameter1' => $parameter1,), array('property1' => $property1,));
- $reportDir: the report directory
- $reportName: the report file name
- $parameters: all the parameters that you need
- $config: all the configs that you need
Embedded documents
There isn't yet...=/
error Orientation Page
I have error xml2pdf: orientation page how to solve this?
error Orientation Page
U can resolve setting the orientation page on the ireport, but if u want u can send me the .jrxml, can u plz?
eric@ericmaicon.com.br!
thx
Parameters ...
Hi, do you have an example with real data ?
I mean, I need to pass a list of objets or an array of Data.
Best Regards.
same problem with Nikolas400
I think, I really have same problem with Nikolas400. still don't find a way to pass serial data from current Db into report...
Parameters ...
can u send me the jrxml plz? can i see the example? or just a pastebin.com
thx!
wonderfull
hi ericmaicon,
I want to update my 2 hours experience. i can solve it finally after several experience with iReport. just create connection to existing database with JDBC, write SQL statement needed, drag dan drop design, add several parameter (it values send by Yii later), save and put in the proper folder. tadaa.. it work directly...
I really amazing what you have done with this extension, it really simplified all report designation.. so, thank you.
I will use this technique to create report on my open source ERP-Accounting Application...
One More: Jasper support to export into several format, including excel, html. is it not available yet in this extension?
Parameters
Hi, peterjkambey, Yes inside iReport you can access an retrieve al data.
But in another application I saw that iReport receive arrays of objects, so I think I could repeat that technique.
Obviusly your solution is one possibility !!!
Regards.
Reply
Hello peter! Thanks!
I
m trying to copy the original lib in java and making in php...but it
ll take some time!!Error: "There isnt`t tag specified in the class: Jasper"
There isnt`t tag specified in the class: Jasper
/home/iproc/public_html/protected/extensions/jasPHP/utils/BeanUtils.php(50)
38
39 if (is_numeric($val) && $attritubeName != 'size') {
40 $instance->{$attritubeName} = PixelUtils::pixeltoMm($val);
41 } else {
42 $instance->{$attritubeName} = $val;
43 }
44 }
45 }
46
47 array_push($returnArray, $instance);
48 }
49 } else {
50 throw new JasperReaderException("There isnt`t tag specified in the class: " . $class);
51 }
52
53 if (count($returnArray) > 1) {
54 return $returnArray;
55 } else {
56 if (count($returnArray) == 0) {
57 return null;
58 }
59
60 return $returnArray[0];
61 }
62 }
What means that error?
Temporary solving of >>> error Orientation Page
I notice the .jrxml generated by iReport (V4.7.1) does not have any orientation instruction inside (only keep track of pageWidth and pageHeight) so I modify the second line of the .jrxml and add orientation="portrait" inside. Some reports works well without it Quite strange behaviour !
This one is solved here
This one also solved should not used the title band of IReport.
Incorrect orientation
i have copy the same code and run the php, but below message is prompt.
Xml2Pdf error : Incorrect orientation:
can someone assist me?
thanks.
jasphp vs ireport
After fixing the 'ireport' extension, I decided to looking 'jasphp'.
I merged the demos, you can download the ireport+jasphp demo and try it online.
I had to make a change in TextUtils to remove extra spaces around '+':
private function gerenalTreatment($finalVar) { //Tratando os valores irrelevantes: $finalVar = preg_replace('/\s+\+\s+/',"",$finalVar); $finalVar = str_replace($this->replacement, "", $finalVar);
Both extension has their + and -: ireport seems to render lines, tables, etc. better, and jasphp seems better structured and seems to render the text better.
Both can read from the database.
passing parameters !!!
hey i have successfully created static reports with the help of jasphp extension
i have created the necessary reports and stored them inside the project
now i want to pass the parameters to generate some reports
this is my actionReport in the Controller (for static reports)
public function actionReport() { $reportfiledir =getcwd() . '/reports/'; $filename = $_GET['file'] . '.jrxml'; $title = 'Hello World!'; Yii::app()->jasPHP->create( $reportfiledir , $filename, array( 'SUBREPORT_DIR'=>'./', 'title' => $title,'parameter1'=>$_GET['p'] )); }
this is the code in the view to get the report (for static reports)
<?php echo CHtml::link('Generate PDF report', array('report','type'=>'jasphp', 'file' => 'report4dasad','p'=>'1')) ?>
can somebody tell me how to pass parameters ??
thank you in advance
usage of jasPHP
Hi all, I just installed jasPHP extension for my application to generate reports in pdf.
I can generate pdf for a string. I need some example for showing table data using controller.
Could you please help me out ? thanks in advanced ...
This is so wrong
Developed under windows and it doesn't respect the case.
I guess I have to find my own way to port phpjasperxml into my projoects, so far it's the best way to use jrxml files into php I found
This is so wrong answer
Sorry to hear that Emil Fedorciuc. It should be one of the most greatest PHP extension. It's so hard to see a decent report tool for PHP, and when i started this extension, i was certain that i was doing great, but it's expend too much time to migrate. In that circumstance i needed to stop the development to finish another things in the company project, so i couldn't spent more time and i stopped the development. Perhaps in the future i can go on with this one.
https://github.com/ericmaicon/jasperToPHP
Php reporting
https://github.com/BBFMedia/PHPJasperXML - this is what I am testing atm, so far many of the features in the jasper report are rendered correctly with php without having to install jasper server.
I already have a few projects and I need to implement a php based reporting tool without the need to install/configure another server, this is the closest to a php reporting tool I could find, I just wanted to test your extension.
I didn't get to test your extension, I am sorry, developing under linux and linux is case sensitive, so for the sake of portability if you name your extension folder "jasphp" use 'ext.jasphp.' instead of 'ext.JasPHP.'. you call fpdf.php in your script with upper case FPDF and I will get file not found errors and so on...
Always call your files using the same casing as they are named. You might want do deploy your project on a linux based hosting at some point and you will get all those errors. Windows ignores the case so there's no problem there.
PHP Reporting
Wow...that's strange Emil Fedorciuc. I use Mac OS...and that's a unix based system..
I'll follow ur advice...thanks
JasPhp is loading pdf report properly. But unicode characters are not displayed in pdf file.
Please suggest any ideas.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.