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,));
Embedded documents
There isn't yet...=/
Total 12 comments
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 '+':
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.
i have copy the same code and run the php, but below message is prompt.
Xml2Pdf error : Incorrect orientation:
can someone assist me?
thanks.
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 !
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?
Hello peter! Thanks!
I
m trying to copy the original lib in java and making in php...but itll take some time!!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.
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?
can u send me the jrxml plz? can i see the example? or just a pastebin.com thx!
I think, I really have same problem with Nikolas400. still don't find a way to pass serial data from current Db into report...
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.
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
I have error xml2pdf: orientation page how to solve this?
Leave a comment
Please login to leave your comment.