├── .all-contributorsrc ├── .coveralls.yml ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .travis.yml ├── CHANGES.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── bin └── jasperstarter │ ├── CHANGES │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── bin │ ├── jasperstarter │ └── jasperstarter.exe │ ├── jdbc │ ├── README │ ├── mysql-connector-java-5.1.48.jar │ └── postgresql-42.2.9.jar │ └── lib │ ├── ant-1.7.1.jar │ ├── ant-launcher-1.7.1.jar │ ├── antlr-2.7.7.jar │ ├── antlr-3.0b5.jar │ ├── argparse4j-0.5.0.jar │ ├── avalon-framework-impl-4.2.0.jar │ ├── barbecue-1.5-beta1.jar │ ├── barcode4j-2.1.jar │ ├── batik-anim-1.9.1.jar │ ├── batik-awt-util-1.9.1.jar │ ├── batik-bridge-1.9.1.jar │ ├── batik-constants-1.9.1.jar │ ├── batik-css-1.9.1.jar │ ├── batik-dom-1.9.1.jar │ ├── batik-ext-1.9.1.jar │ ├── batik-gvt-1.9.1.jar │ ├── batik-i18n-1.9.1.jar │ ├── batik-parser-1.9.1.jar │ ├── batik-script-1.9.1.jar │ ├── batik-svg-dom-1.9.1.jar │ ├── batik-svggen-1.9.1.jar │ ├── batik-util-1.9.1.jar │ ├── batik-xml-1.9.1.jar │ ├── bcprov-jdk15on-1.52.jar │ ├── castor-core-1.3.3.jar │ ├── castor-xml-1.3.3.jar │ ├── commons-beanutils-1.9.3.jar │ ├── commons-cli-1.0.jar │ ├── commons-codec-1.10.jar │ ├── commons-collections-3.2.2.jar │ ├── commons-collections4-4.1.jar │ ├── commons-digester-2.1.jar │ ├── commons-io-2.5.jar │ ├── commons-lang-2.6.jar │ ├── commons-logging-1.1.1.jar │ ├── ecj-4.4.2.jar │ ├── groovy-all-2.4.12.jar │ ├── icu4j-57.1.jar │ ├── itext-2.1.7.js6.jar │ ├── jackson-annotations-2.9.5.jar │ ├── jackson-core-2.9.5.jar │ ├── jackson-databind-2.9.5.jar │ ├── jasperreports-6.7.0.jar │ ├── jasperreports-chart-customizers-6.7.0.jar │ ├── jasperreports-chart-themes-6.7.0.jar │ ├── jasperreports-fonts-6.0.0.jar │ ├── jasperreports-functions-6.7.0.jar │ ├── jasperstarter.jar │ ├── javax.inject-1.jar │ ├── jcalendar-1.4.jar │ ├── jcommon-1.0.23.jar │ ├── jfreechart-1.0.19.jar │ ├── joda-time-2.9.9.jar │ ├── jython-2.7.0.jar │ ├── log4j-1.2.17.jar │ ├── poi-3.17.jar │ ├── rhino-1.7.7.2.jar │ ├── serializer-2.7.2.jar │ ├── servlet-api-2.5.jar │ ├── spring-beans-4.3.21.RELEASE.jar │ ├── spring-core-4.3.21.RELEASE.jar │ ├── spring-expression-4.3.21.RELEASE.jar │ ├── stax-1.2.0.jar │ ├── stax-api-1.0-2.jar │ ├── stax-api-1.0.1.jar │ ├── stringtemplate-3.0.jar │ ├── xalan-2.7.2.jar │ ├── xml-apis-1.3.04.jar │ ├── xml-apis-ext-1.3.04.jar │ └── xmlgraphics-commons-2.2.jar ├── composer.json ├── composer.lock ├── docker-compose.yml ├── docs ├── images │ └── phpjasper.png └── pt_BR │ └── LEIA-ME_pt_BR.md ├── examples ├── .gitignore ├── CancelAck.jrxml ├── CancelAck.xml ├── contacts.json ├── hello_world.jrxml ├── hello_world_params.jrxml └── json.jrxml ├── phpcs.xml ├── phpunit.xml.dist ├── src ├── Exception │ ├── ErrorCommandExecutable.php │ ├── InvalidCommandExecutable.php │ ├── InvalidFormat.php │ ├── InvalidInputFile.php │ └── InvalidResourceDirectory.php └── PHPJasper.php └── tests ├── PHPJasperTest.php └── test.jrxml /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "geekcom", 10 | "name": "Daniel Rodrigues", 11 | "avatar_url": "https://avatars2.githubusercontent.com/u/3955933?v=4", 12 | "profile": "https://twitter.com/geekcom2", 13 | "contributions": [ 14 | "infra", 15 | "maintenance", 16 | "code" 17 | ] 18 | }, 19 | { 20 | "login": "lavela", 21 | "name": "Leandro Bitencourt", 22 | "avatar_url": "https://avatars2.githubusercontent.com/u/13982234?v=4", 23 | "profile": "http://www.leandrobitencourt.com.br", 24 | "contributions": [ 25 | "code" 26 | ] 27 | }, 28 | { 29 | "login": "vitormattos", 30 | "name": "Vitor Mattos", 31 | "avatar_url": "https://avatars3.githubusercontent.com/u/1079143?v=4", 32 | "profile": "https://github.com/vitormattos", 33 | "contributions": [ 34 | "code" 35 | ] 36 | }, 37 | { 38 | "login": "rafaelqueiroz", 39 | "name": "Rafael Queiroz", 40 | "avatar_url": "https://avatars0.githubusercontent.com/u/275919?v=4", 41 | "profile": "https://github.com/rafaelqueiroz", 42 | "contributions": [ 43 | "code" 44 | ] 45 | }, 46 | { 47 | "login": "dbould", 48 | "name": "Dave Bould", 49 | "avatar_url": "https://avatars0.githubusercontent.com/u/5477476?v=4", 50 | "profile": "http://dave.codes", 51 | "contributions": [ 52 | "code" 53 | ] 54 | }, 55 | { 56 | "login": "ThiagoAlves31", 57 | "name": "ThiagoAlves31", 58 | "avatar_url": "https://avatars1.githubusercontent.com/u/32931011?v=4", 59 | "profile": "https://github.com/ThiagoAlves31", 60 | "contributions": [ 61 | "code" 62 | ] 63 | }, 64 | { 65 | "login": "jadsonbr", 66 | "name": "Jadson Ribeiro", 67 | "avatar_url": "https://avatars3.githubusercontent.com/u/10354607?v=4", 68 | "profile": "http://www.jadsonbr.com.br", 69 | "contributions": [ 70 | "code" 71 | ] 72 | }, 73 | { 74 | "login": "boaglio", 75 | "name": "Fernando Boaglio", 76 | "avatar_url": "https://avatars0.githubusercontent.com/u/6140?v=4", 77 | "profile": "http://www.boaglio.com", 78 | "contributions": [ 79 | "code" 80 | ] 81 | }, 82 | { 83 | "login": "xRahul", 84 | "name": "Rahul Jain", 85 | "avatar_url": "https://avatars3.githubusercontent.com/u/1639945?v=4", 86 | "profile": "https://rahulja.in", 87 | "contributions": [ 88 | "code" 89 | ] 90 | }, 91 | { 92 | "login": "lecneri", 93 | "name": "Luiz Eduardo", 94 | "avatar_url": "https://avatars2.githubusercontent.com/u/431453?v=4", 95 | "profile": "https://github.com/lecneri", 96 | "contributions": [ 97 | "code" 98 | ] 99 | }, 100 | { 101 | "login": "davidribeiro", 102 | "name": "David Ribeiro", 103 | "avatar_url": "https://avatars0.githubusercontent.com/u/11426456?v=4", 104 | "profile": "https://github.com/davidribeiro", 105 | "contributions": [ 106 | "code" 107 | ] 108 | }, 109 | { 110 | "login": "allenjd3", 111 | "name": "James Allen", 112 | "avatar_url": "https://avatars3.githubusercontent.com/u/8092154?v=4", 113 | "profile": "https://allenjd3.github.io", 114 | "contributions": [ 115 | "code" 116 | ] 117 | } 118 | ], 119 | "contributorsPerLine": 7, 120 | "projectName": "phpjasper", 121 | "projectOwner": "PHPJasper", 122 | "repoType": "github", 123 | "repoHost": "https://github.com", 124 | "skipCi": true 125 | } 126 | -------------------------------------------------------------------------------- /.coveralls.yml: -------------------------------------------------------------------------------- 1 | # for php-coveralls 2 | service_name: travis-ci 3 | coverage_clover: tests/log/clover.xml 4 | json_path: tests/log/coveralls-upload.json -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://nubank.com.br/pagar/518o5/zVBzxd00Sb -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Desktop (please complete the following information):** 24 | - OS: [e.g. iOS] 25 | - Browser [e.g. chrome, safari] 26 | - Version [e.g. 22] 27 | 28 | **Additional context** 29 | Add any other context about the problem here. 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /tests/log 3 | phpunit.xml 4 | *.jasper 5 | *.cache 6 | 7 | # IDE 8 | ## Eclipse 9 | .buildpath 10 | .project 11 | .settings 12 | ## PHPStorm 13 | .idea/ 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.2 5 | - 7.3 6 | - 7.4 7 | - 8.0 8 | 9 | before_script: 10 | - composer self-update 11 | - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader 12 | - composer install --prefer-source --no-interaction --dev 13 | - echo 'xdebug.mode = coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini 14 | 15 | script: 16 | - composer test 17 | 18 | after_success: 19 | - php vendor/bin/php-coveralls --verbose 20 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | Release Notes - PHPJasper - Version 3.4.0 2 | ======================================================== 3 | * Update 4 | * Exception::__construct(): Passing null to parameter #2 ($code) of type int is deprecated (Solved) 5 | * Capture JasperStarter errors and include them in ErrorCommandExecutable exception message 6 | * PathExecutable parameter 7 | * Update composer libs 8 | * Update phpjasper docker image 9 | * Update doc 10 | ________________________________________________ 11 | Release Notes - PHPJasper - Version 3.3.0 12 | ======================================================== 13 | * Improvement 14 | * add support to coverage tests 15 | * add support to travisCI 16 | * Static Analysis with phpstan 17 | * add phpunit.xml.dist 18 | * new badges 19 | ________________________________________________ 20 | Release Notes - PHPJasper - Version 3.2.0 21 | ======================================================== 22 | * Improvement 23 | * minimum PHP version now is 7.2 24 | https://www.php.net/supported-versions.php 25 | * phpunit minimal now is 8.* 26 | * Update 27 | * suggested jdbc drivers in the folder bin/jasperstarter/jdbc 28 | * update tests and phpunit.xml 29 | * docs 30 | * Remove 31 | * break test 32 | ________________________________________________ 33 | Release Notes - PHPJasper - Version 3.1.0 34 | ======================================================== 35 | * Improvement 36 | * added printOutput() method 37 | * Refactoring 38 | * output() method 39 | ________________________________________________________ 40 | Release Notes - PHPJasper - Version 3.0.0 41 | ======================================================== 42 | * Improvement 43 | * added Semantic Versioning 2.0.0 44 | * Update 45 | * updated for jasperstarter 3.5.0 46 | * Bug 47 | * solved problems with useSSL at MySQL connections 48 | ________________________________________________________ 49 | Release Notes - PHPJasper - Version 2.7 50 | ======================================================== 51 | * Improvement https://github.com/PHPJasper/phpjasper/issues/99 52 | * improvement in resource '-r' parameter, 53 | it's no longer necessary to be connected in database 54 | to use resources 55 | ________________________________________________________ 56 | Release Notes - PHPJasper - Version 2.6 57 | ======================================================== 58 | * Update 59 | * updated for jasperstarter 3.2.1 60 | ________________________________________________________ 61 | Release Notes - PHPJasper - Version 2.5 62 | ======================================================== 63 | * https://github.com/PHPJasper/phpjasper/pull/77 64 | * https://github.com/PHPJasper/phpjasper/pull/78 65 | * https://github.com/PHPJasper/phpjasper/pull/79 66 | * https://github.com/PHPJasper/phpjasper/pull/80 67 | ________________________________________________________ 68 | 69 | Release Notes - PHPJasper - Version 2.2 70 | ======================================================== 71 | * Improvement: https://github.com/PHPJasper/phpjasper/issues/30 72 | * add support for resource option 73 | ________________________________________________________ 74 | 75 | Release Notes - PHPJasper - Version 2.1 76 | ======================================================== 77 | * Refactoring 78 | * strict types activate 79 | * add type declarations 80 | ________________________________________________________ 81 | Release Notes - PHPJasper - Version 2.0 82 | ======================================================== 83 | * Improvement 84 | * Support php 7.1 above 85 | ________________________________________________________ 86 | 87 | Release Notes - PHPJasper - Version 1.15 88 | ======================================================== 89 | * Improvement 90 | * Updated JasperStarter to Version 3.1.0 91 | ________________________________________________________ 92 | 93 | Release Notes - JasperStarter - Version 3.1.0 94 | ======================================================== 95 | 96 | * New Feature 97 | * [JAS-83] - JSON file as a data source 98 | 99 | * Task 100 | * [JAS-95] - Include JasperReports 6.4.0 101 | 102 | * Improvement 103 | * [JAS-84] - How to pass $P{XML_DATA_DOCUMENT} to sub report - additional documentation 104 | ________________________________________________________ 105 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at danielrodrigues-ti@hotmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | 1. Fork it 4 | 2. Create your feature branch : `git checkout -b my_new_feature` 5 | 3. Commit your changes: `git commit -m "Add some feature"` 6 | 4. Push to the branch `git push origin my_new_feature` -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Hélder Duarte 4 | Copyright (c) 2015 Daniel Rodrigues Lima (geekcom) 5 | Copyright (c) 2015 Leandro Bitencourt 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | this software and associated documentation files (the "Software"), to deal in 9 | the Software without restriction, including without limitation the rights to 10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | the Software, and to permit persons to whom the Software is furnished to do so, 12 | subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![PHPJasper logo](docs/images/phpjasper.png) 2 | 3 | 4 | # PHPJasper 5 | _A PHP Report Generator_ 6 | 7 | [![Build Status](https://api.travis-ci.com/PHPJasper/phpjasper.svg?branch=master)](https://app.travis-ci.com/github/PHPJasper/phpjasper) 8 | [![Coverage Status](https://coveralls.io/repos/github/PHPJasper/phpjasper/badge.svg?branch=master)](https://coveralls.io/github/PHPJasper/phpjasper?branch=master) 9 | [![Latest Stable Version](https://poser.pugx.org/geekcom/phpjasper/v/stable)](https://packagist.org/packages/geekcom/phpjasper) 10 | [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%207.2-blue.svg?style=flat-square)](https://php.net/) 11 | [![Total Downloads](https://poser.pugx.org/geekcom/phpjasper/downloads)](https://packagist.org/packages/geekcom/phpjasper) 12 | [![License](https://poser.pugx.org/geekcom/phpjasper/license)](https://packagist.org/packages/geekcom/phpjasper) 13 | [![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan) 14 | [![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-) 15 | 16 | 17 | ### Docs 18 | 19 | [![Language-pt_BR](https://img.shields.io/badge/pt__BR-100%25-green.svg?style=flat-square)](https://github.com/PHPJasper/phpjasper/blob/master/docs/pt_BR/LEIA-ME_pt_BR.md) 20 | 21 | > ### Please consider **[make a donation](https://blockchain.com/btc/payment_request?address=1MDkixV6Xn9yQoKLDLdznLwmbKrJ9VAThj&amount=0.00001737&message=PHPJasper_Support)**, support our activities 22 | 23 | ### About 24 | PHPJasper is the best solution to compile and process JasperReports (.jrxml & .jasper files) just using PHP, in short: to generate reports using PHP. 25 | 26 | #### Our channel on discord 27 | https://discord.gg/7FpDnQ 28 | 29 | **Notes:** 30 | * PHPJasper Can be used regardless of your PHP Framework 31 | * For PHP versions less than 7.0 see: [v1.16](https://github.com/PHPJasper/phpjasper/releases/tag/v1.16) 32 | * [Here](https://github.com/PHPJasper/examples) are several examples of how to use PHPJasper 33 | 34 | ### Why PHPJasper? 35 | 36 | Did you ever had to create a good looking Invoice with a lot of fields for your great web app? 37 | 38 | I had to, and the solutions out there were not perfect. Generating *HTML* + *CSS* to make a *PDF*? That doesn't make any sense! :) 39 | 40 | Then I found **JasperReports** the best open source solution for reporting. 41 | 42 | ### What can I do with this? 43 | 44 | Well, everything. JasperReports is a powerful tool for **reporting** and **BI**. 45 | 46 | **From their website:** 47 | 48 | > The JasperReports Library is the world's most popular open source reporting engine. It is entirely written in Java and it is able to use data coming from any kind of data source and produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Excel, OpenOffice and Word. 49 | 50 | It is recommended using [Jaspersoft Studio](http://community.jaspersoft.com/project/jaspersoft-studio) to build your reports, connect it to your datasource (ex: MySQL, POSTGRES), loop thru the results and output it to PDF, XLS, DOC, RTF, ODF, etc. 51 | 52 | *Some examples of what you can do:* 53 | 54 | * Invoices 55 | * Reports 56 | * Listings 57 | 58 | ## Requirements 59 | 60 | * PHP 7.2 or above 61 | * Java JDK 1.8 62 | 63 | ## Optional 64 | 65 | * Any `jdbc` drivers to generate reports from a database (MySQL, PostgreSQL, MSSQL...), must be copied to a folder `bin/jasperstarter/jdbc` 66 | * We ship the [PostgreSQL](https://jdbc.postgresql.org/) (42.2.9) in the `bin/jasperstarter/jdbc` directory. 67 | * We ship the [MySQL connector](http://dev.mysql.com/downloads/connector/j/) (v5.1.48) in the `bin/jasperstarter/jdbc` directory. 68 | * [Microsoft JDBC Drivers SQL Server 69 | ](https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15). 70 | * [Jaspersoft Studio](http://community.jaspersoft.com/project/jaspersoft-studio) (to draw your reports). 71 | 72 | ## Installation 73 | 74 | Install [Composer](http://getcomposer.org) if you don't have it. 75 | ``` 76 | composer require geekcom/phpjasper 77 | ``` 78 | Or in your file'composer.json' add: 79 | 80 | ```json 81 | { 82 | "require": { 83 | "geekcom/phpjasper": "^3.4.0" 84 | } 85 | } 86 | ``` 87 | 88 | And the just run: 89 | 90 | composer install 91 | 92 | and thats it. 93 | 94 | ---------------------------------------------------------------------------------------------------------------------------- 95 | 96 | ## PHPJasper with Docker 97 | 98 | With Docker CE and docker-compose installed just run: 99 | 100 | * `docker-compose up -d` 101 | * `docker exec -it phpjasper composer install` 102 | 103 | To execute tests: 104 | 105 | * `docker exec -it phpjasper sudo composer test` or 106 | * `docker exec -it phpjasper sudo composer testdox` 107 | 108 | To see coverage manually of tests, execute the file: `tests/log/report/index.html` 109 | 110 | _Help us writing new tests, make a fork_ :) 111 | 112 | ---------------------------------------------------------------------------------------------------------------------------- 113 | 114 | ## Examples 115 | 116 | ### The *Hello World* example. 117 | 118 | Go to the examples directory in the root of the repository (`vendor/geekcom/phpjasper/examples`). 119 | Open the `hello_world.jrxml` file with Jaspersoft Studio or with your favorite text editor and take a look at the source code. 120 | 121 | #### Compiling 122 | 123 | First we need to compile our `JRXML` file into a `JASPER` binary file. We just have to do this one time. 124 | 125 | **Note 1:** You don't need to do this step if you are using *Jaspersoft Studio*. You can compile directly within the program. 126 | 127 | ```php 128 | 129 | require __DIR__ . '/vendor/autoload.php'; 130 | 131 | use PHPJasper\PHPJasper; 132 | 133 | $input = __DIR__ . '/vendor/geekcom/phpjasper/examples/hello_world.jrxml'; 134 | 135 | $jasper = new PHPJasper; 136 | $jasper->compile($input)->execute(); 137 | ``` 138 | 139 | This commando will compile the `hello_world.jrxml` source file to a `hello_world.jasper` file. 140 | 141 | #### Processing 142 | 143 | Now lets process the report that we compile before: 144 | 145 | ```php 146 | 147 | require __DIR__ . '/vendor/autoload.php'; 148 | 149 | use PHPJasper\PHPJasper; 150 | 151 | $input = __DIR__ . '/vendor/geekcom/phpjasper/examples/hello_world.jasper'; 152 | $output = __DIR__ . '/vendor/geekcom/phpjasper/examples'; 153 | $options = [ 154 | 'format' => ['pdf', 'rtf'] 155 | ]; 156 | 157 | $jasper = new PHPJasper; 158 | 159 | $jasper->process( 160 | $input, 161 | $output, 162 | $options 163 | )->execute(); 164 | ``` 165 | 166 | Now check the examples folder! :) Great right? You now have 2 files, `hello_world.pdf` and `hello_world.rtf`. 167 | 168 | Check the *methods* `compile` and `process` in `src/JasperPHP.php` for more details 169 | 170 | #### Listing Parameters 171 | 172 | Querying the jasper file to examine parameters available in the given jasper report file: 173 | 174 | ```php 175 | 176 | require __DIR__ . '/vendor/autoload.php'; 177 | 178 | use PHPJasper\PHPJasper; 179 | 180 | $input = __DIR__ . '/vendor/geekcom/phpjasper/examples/hello_world_params.jrxml'; 181 | 182 | $jasper = new PHPJasper; 183 | $output = $jasper->listParameters($input)->execute(); 184 | 185 | foreach($output as $parameter_description) 186 | print $parameter_description . '
';
187 | ```
188 | 
189 | ### Using database to generate reports
190 | 
191 | We can also specify parameters for connecting to database:
192 | 
193 | ```php
194 | require __DIR__ . '/vendor/autoload.php';
195 | 
196 | use PHPJasper\PHPJasper;    
197 | 
198 | $input = '/your_input_path/your_report.jasper';   
199 | $output = '/your_output_path';
200 | $options = [
201 |     'format' => ['pdf'],
202 |     'locale' => 'en',
203 |     'params' => [],
204 |     'db_connection' => [
205 |         'driver' => 'postgres', //mysql, ....
206 |         'username' => 'DB_USERNAME',
207 |         'password' => 'DB_PASSWORD',
208 |         'host' => 'DB_HOST',
209 |         'database' => 'DB_DATABASE',
210 |         'port' => '5432'
211 |     ]
212 | ];
213 | 
214 | $jasper = new PHPJasper;
215 | 
216 | $jasper->process(
217 |         $input,
218 |         $output,
219 |         $options
220 | )->execute();
221 | ```
222 | 
223 | **Note 2:**
224 | 
225 | For a complete list of locales see [Supported Locales](http://www.oracle.com/technetwork/java/javase/java8locales-2095355.html)
226 | 
227 | ### Using MSSQL DataBase
228 | 
229 | ```php
230 | require __DIR__ . '/vendor/autoload.php';
231 | 
232 | use PHPJasper\PHPJasper;
233 | 
234 | $input = '/your_input_path/your_report.jasper or .jrxml';   
235 | $output = '/your_output_path';
236 | $jdbc_dir = __DIR__ . '/vendor/geekcom/phpjasper/bin/jaspertarter/jdbc';
237 | $options = [
238 |     'format' => ['pdf'],
239 |     'locale' => 'en',
240 |     'params' => [],
241 |     'db_connection' => [
242 |         'driver' => 'generic',
243 |         'host' => '127.0.0.1',
244 |         'port' => '1433',
245 |         'database' => 'DataBaseName',
246 |         'username' => 'UserName',
247 |         'password' => 'password',
248 |         'jdbc_driver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
249 |         'jdbc_url' => 'jdbc:sqlserver://127.0.0.1:1433;databaseName=Teste',
250 |         'jdbc_dir' => $jdbc_dir
251 |     ]
252 | ];
253 | 
254 | $jasper = new PHPJasper;
255 | 
256 | $jasper->process(
257 |         $input,
258 |         $output,
259 |         $options
260 |     )->execute();
261 | ```
262 | 
263 | ### Reports from a XML
264 | 
265 | ```php
266 | require __DIR__ . '/vendor/autoload.php';
267 | 
268 | use PHPJasper\PHPJasper;
269 | 
270 | $input = '/your_input_path/your_report.jasper';   
271 | $output = '/your_output_path';
272 | $data_file = __DIR__ . '/your_data_files_path/your_xml_file.xml';
273 | $options = [
274 |     'format' => ['pdf'],
275 |     'params' => [],
276 |     'locale' => 'en',
277 |     'db_connection' => [
278 |         'driver' => 'xml',
279 |         'data_file' => $data_file,
280 |         'xml_xpath' => '/your_xml_xpath'
281 |     ]
282 | ];
283 | 
284 | $jasper = new PHPJasper;
285 | 
286 | $jasper->process(
287 |     $input,
288 |     $output,
289 |     $options
290 | )->execute();
291 | ```
292 | 
293 | ### Reports from a JSON
294 | 
295 | ```php
296 | require __DIR__ . '/vendor/autoload.php';
297 | 
298 | use PHPJasper\PHPJasper;
299 | 
300 | $input = '/your_input_path/your_report.jasper';   
301 | $output = '/your_output_path';
302 | 
303 | $data_file = __DIR__ . '/your_data_files_path/your_json_file.json';
304 | $options = [
305 |     'format' => ['pdf'],
306 |     'params' => [],
307 |     'locale' => 'en',
308 |     'db_connection' => [
309 |         'driver' => 'json',
310 |         'data_file' => $data_file,
311 |         'json_query' => 'your_json_query'
312 |     ]
313 | ];
314 | 
315 | $jasper = new PHPJasper;
316 | 
317 | $jasper->process(
318 |     $input,
319 |     $output,
320 |     $options
321 | )->execute();
322 | ```
323 | 
324 | ## Performance
325 | 
326 | Depends on the complexity, amount of data and the resources of your machine (let me know your use case).
327 | 
328 | I have a report that generates a *Invoice* with a DB connection, images and multiple pages and it takes about **3/4 seconds** to process. I suggest that you use a worker to generate the reports in the background.
329 | 
330 | ## Thanks
331 | 
332 | [Cenote GmbH](http://www.cenote.de/) for the [JasperStarter](http://jasperstarter.sourceforge.net/) tool.
333 | 
334 | [JetBrains](https://www.jetbrains.com/) for the [PhpStorm](https://www.jetbrains.com/phpstorm/) and all great tools.
335 | 
336 | 
337 | ## [Questions?](https://github.com/PHPJasper/phpjasper/issues)
338 | 
339 | Open a new [Issue](https://github.com/PHPJasper/phpjasper/issues) or look for a closed issue
340 | 
341 | 
342 | ## [License](https://github.com/PHPJasper/phpjasper/blob/master/LICENSE)
343 | 
344 | MIT
345 | 
346 | ## [Contribute](https://github.com/PHPJasper/phpjasper/blob/master/CONTRIBUTING.md)
347 | ## Contributors ✨
348 | 
349 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
350 | 
351 | 
352 | 
353 | 
354 | 
355 |   
356 |     
357 |     
358 |     
359 |     
360 |     
361 |     
362 |     
363 |   
364 |   
365 |     
366 |     
367 |     
368 |     
369 |     
370 |   
371 | 

Daniel Rodrigues

🚇 🚧 💻

Leandro Bitencourt

💻

Vitor Mattos

💻

Rafael Queiroz

💻

Dave Bould

💻

ThiagoAlves31

💻

Jadson Ribeiro

💻

Fernando Boaglio

💻

Rahul Jain

💻

Luiz Eduardo

💻

David Ribeiro

💻

James Allen

💻
372 | 373 | 374 | 375 | 376 | 377 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 378 | -------------------------------------------------------------------------------- /bin/jasperstarter/CHANGES: -------------------------------------------------------------------------------- 1 | 2 | JasperStarter - Running JasperReports from command line 3 | ======================================================== 4 | 5 | Release notes - JasperStarter - Version 3.5.0 6 | --------------------------------------------- 7 | 8 | ** Bug 9 | * [JAS-134] - "InterruptedException" should not be ignored in App.java 10 | * [JAS-135] - comparisons between unrelated types in Config.java 11 | 12 | ** New Feature 13 | * [JAS-131] - Jasperstarter does not provide a way to use the query string saved in the report itself 14 | 15 | ** Task 16 | * [JAS-133] - Release Pipeline takes longer than before 17 | * [JAS-136] - Throwable.printStackTrace(...) should not be called in Report.java setLookAndFeel() 18 | * [JAS-137] - Do not use a bitwise operator with a Boolean-like operand in ParameterPanel.java 19 | * [JAS-138] - Do not use a bitwise operator with a Boolean-like operand in ParameterPrompt.java 20 | 21 | 22 | Release notes - JasperStarter - Version 3.4.1 23 | --------------------------------------------- 24 | 25 | ** Bug 26 | * [JAS-132] - Security alert on org.springframework:spring-core 27 | Updated springframework to 4.3.21 28 | 29 | CVE-2016-5007 - moderate severity - Vulnerable versions: < 4.3.1 30 | CVE-2018-1275 - high severity - Vulnerable versions: < 4.3.16 31 | CVE-2018-1272 - moderate severity - Vulnerable versions: < 4.3.15 32 | CVE-2018-1271 - moderate severity - Vulnerable versions: < 4.3.15 33 | CVE-2018-1270 - high severity - Vulnerable versions: < 4.3.16 34 | CVE-2018-1257 - moderate severity - Vulnerable versions: < 4.3.17 35 | 36 | 37 | Release notes - JasperStarter - Version 3.4.0 38 | --------------------------------------------- 39 | 40 | JasperStarter-3.2.0 silently dropped Java7 support by using the 41 | latest available JasperReports Library. 42 | JasperReports-6.4.0 is the last release which works with Java7 so 43 | JasperStarter-3.1.0 was the latest release supporting Java7. 44 | 45 | Now JasperStarter needs Java8 at a minimum and is manually tested 46 | with OpenJDK-8, OpenJDK-10, OpenJDK-11. Automatic testing is on the 47 | way (see JAS-128). 48 | There will be a special release supporting Java7. 49 | 50 | "Diskless" operation using stdin and stdout for input data and 51 | output is now complete. See ([JAS-97] and [JAS-89]). 52 | 53 | A public API allows direct integration with Python using jpy 54 | ([JAS-125]). 55 | 56 | Known bugs: 57 | * [JAS-120] - JasperReports-6.7.0 Version does not match with 58 | reported version from the jar file in 59 | This is an upstream error which causes JasperStarter to put out 60 | a wrong JasperReports version number of 6.6.0 instead of 6.7.0 61 | if you call: jasperstarter -V 62 | 63 | ** Bug 64 | * [JAS-111] - JRE 1.7 incompatibility - not fixed in the main 65 | release but clarified. 66 | * [JAS-122] - Runtime error if a chart with "chart customizers" is 67 | used 68 | * [JAS-126] - Jasperstarter does not usefully propagate 69 | compilation errors 70 | 71 | ** New Feature 72 | * [JAS-97] - Use stdout for the resulting PDF (so we don't have to 73 | write to the hosting server's storage) 74 | * [JAS-125] - Make report fill accessible via API 75 | 76 | ** Task 77 | * [JAS-127] - Enable dependency caching in build pipeline 78 | * [JAS-129] - Remove test dependency to font Arial 79 | * [JAS-130] - launch4j-maven-plugin:1.5.2 depends on 32bit 80 | libraries 81 | 82 | 83 | Release notes - JasperStarter - Version 3.3.0 84 | --------------------------------------------- 85 | 86 | Known bugs: 87 | * [JAS-120] - JasperReports-6.7.0 Version does not match with reported version from the jar file in 88 | This is an upstream error which causes JasperStarter to put out 89 | a wrong JasperReports version number of 6.6.0 instead of 6.7.0 90 | if you call: jasperstarter -V 91 | 92 | ** Bug 93 | * [JAS-116] - SSL error 94 | * [JAS-121] - Container 'Build' exceeded memory limit. 95 | * [JAS-122] - Runtime error if a chart with "chart customizers" is used 96 | 97 | ** New Feature 98 | * [JAS-113] - JSONQL data source support 99 | 100 | ** Task 101 | * [JAS-102] - Pipeline: enable build artifact upload to download section 102 | * [JAS-119] - Include JasperReports-6.7.0 103 | 104 | ** Improvement 105 | * [JAS-89] - Accept stdin for datafile input 106 | 107 | 108 | Release Notes - JasperStarter - Version 3.2.1 109 | --------------------------------------------- 110 | 111 | ** Task 112 | * [JAS-109] - Include JasperReports-6.4.3 113 | 114 | 115 | Release Notes - JasperStarter - Version 3.2.0 116 | --------------------------------------------- 117 | 118 | ** Bug 119 | * [JAS-96] - Enable JavaScript in expression 120 | * [JAS-99] - jasperreports-functions not in maven central 121 | * [JAS-100] - Pipeline build failed: Font "Arial" is not available to the JVM 122 | * [JAS-101] - Pipeline build failed: net.sf.launch4j.ExecException: java.io.IOException: Cannot run program 123 | * [JAS-107] - JasperStarter could not run reports with Barcode4J barcodes 124 | 125 | ** Task 126 | * [JAS-108] - Include JasperReports 6.4.1 127 | 128 | 129 | Release Notes - JasperStarter - Version 3.1.0 130 | --------------------------------------------- 131 | 132 | ** New Feature 133 | * [JAS-83] - JSON file as a data source 134 | 135 | ** Task 136 | * [JAS-95] - Include JasperReports 6.4.0 137 | 138 | ** Improvement 139 | * [JAS-84] - How to pass $P{XML_DATA_DOCUMENT} to sub report - additional documentation 140 | 141 | 142 | Release Notes - JasperStarter - Version 3.0.0 143 | --------------------------------------------- 144 | 145 | This Release works with Java8. 146 | 147 | ** Bug 148 | * [JAS-69] - Calls of assertEquals have the arguments actual and 149 | expected interchanged 150 | * [JAS-70] - Example report csv.jrxml truncates data 151 | * [JAS-80] - jasperstarter by default is missing some important 152 | jasper studio builtin libraries 153 | * [JAS-81] - Eclipse compiler error when running using Java 8 154 | 155 | ** Improvement 156 | * [JAS-68] - Expand documentation with calls of running the 157 | example reports 158 | 159 | ** New Feature 160 | * [JAS-67] - Ability to produce CSV Metadata reports 161 | * [JAS-72] - Ability to produce XLS Metadata reports 162 | 163 | ** Task 164 | * [JAS-57] - Switching from Mercurial to Git 165 | * [JAS-59] - Include JasperReports 6.0.0 166 | * [JAS-61] - update dependencies 167 | * [JAS-65] - Include JasperReports 6.0.2 168 | * [JAS-66] - Include JasperReports 6.0.3 169 | * [JAS-76] - Git version and revision information in manifest file 170 | * [JAS-79] - Include JasperReports 6.0.4 171 | 172 | 173 | Release Notes - JasperStarter - Version 2.2.2 174 | ---------------------------------------------- 175 | 176 | ** Bug 177 | * [JAS-63] - Version 2.2 WindowsSetup replace the path variable 178 | 179 | 180 | Release Notes - JasperStarter - Version 2.2.1 181 | ---------------------------------------------- 182 | 183 | ** Bug 184 | * [JAS-58] - DB type generic should not require a username 185 | * [JAS-62] - Linux startup script does not work if called via symlink 186 | 187 | ** Task 188 | * [JAS-57] - Switching from Mercurial to Git (Branch Jasperstarter-2.2) 189 | 190 | 191 | Release Notes - JasperStarter - Version 2.2.0 192 | ---------------------------------------------- 193 | 194 | ** Bug 195 | * [JAS-54] - Eclipse complains: Plugin execution not covered by 196 | lifecycle configuration 197 | 198 | ** New Feature 199 | * [JAS-56] - Support for XML data sources 200 | 201 | ** Task 202 | * [JAS-48] - Rewrite api calls deprecated since JasperReports 5.6.0 203 | * [JAS-49] - Rewrite code reported by -Xlint:unchecked 204 | 205 | 206 | Release Notes - JasperStarter - Version 2.1.2 207 | --------------------------------------------- 208 | 209 | ** Bug 210 | * [JAS-53] - Property net.sf.jasperreports.export.xls.one.page.per.sheet was overrided 211 | 212 | 213 | Release Notes - JasperStarter - Version 2.1.1 214 | ---------------------------------------------- 215 | 216 | ** Task 217 | * [JAS-52] - Include JasperReports 5.6.1 218 | 219 | 220 | Release Notes - JasperStarter - Version 2.1.0 221 | ---------------------------------------------- 222 | 223 | ** Bug 224 | * [JAS-40] - No page title is set in index.html 225 | 226 | ** New Feature 227 | * [JAS-50] - Accept number of copies when printing 228 | 229 | ** Task 230 | * [JAS-47] - Include JasperReports 5.6.0 231 | 232 | 233 | Release Notes - JasperStarter - Version 2.0.0 234 | ---------------------------------------------- 235 | 236 | The command line syntax has changed in this release! 237 | is now an argument and the format of report parameters has changed. 238 | Specifying the parameter type is no longer necessary. The type is determined 239 | from the report and it is no longer possible to provide a non existent 240 | parameter. 241 | The major new feature is support for csv files as a datasource. 242 | 243 | ** Bug 244 | * [JAS-37] - The artifact org.apache.commons:commons-io:jar:1.3.2 has been 245 | relocated to commons-io:commons-io:jar:1.3.2 246 | * [JAS-41] - Command "jasperstarter params" gives no useful result if param 247 | has no description 248 | 249 | ** Improvement 250 | * [JAS-15] - Report parameters should be handled in a more generic way 251 | * [JAS-42] - Accept as positional argument instead of an option 252 | 253 | ** New Feature 254 | * [JAS-30] - CSV as a datasource for Jasperstarter 255 | 256 | ** Task 257 | * [JAS-23] - create unit test 258 | * [JAS-24] - create example reports 259 | * [JAS-34] - site translation de for release 2.0 260 | * [JAS-35] - site translation cz for release 2.0 261 | * [JAS-38] - Update build dependencies 262 | * [JAS-39] - Include JasperReports 5.2.0 263 | 264 | 265 | Release Notes - JasperStarter - Version 1.4.2 266 | ---------------------------------------------- 267 | 268 | ** Bug 269 | * [JAS-41] - Command "jasperstarter params" gives no useful result 270 | if param has no description 271 | 272 | 273 | Release Notes - JasperStarter - Version 1.4.1 274 | ---------------------------------------------- 275 | 276 | ** Bug 277 | * [JAS-33] - Report parameter with space produces error on Unix 278 | like systems 279 | 280 | 281 | Release Notes - JasperStarter - Version 1.4.0 282 | ---------------------------------------------- 283 | 284 | ** Bug 285 | * [JAS-29] - Documentation typo java.awt.image 286 | 287 | ** Task 288 | * [JAS-31] - Include JasperReports 5.1.2 289 | * [JAS-32] - Include argparse4j 0.4.1 290 | 291 | 292 | Release Notes - JasperStarter - Version 1.3.0 293 | ---------------------------------------------- 294 | 295 | This release is mainly due to the new JasperReports library version 5.1.0. 296 | 297 | ** Improvement 298 | * [JAS-28] - Include argparse4j 0.4.0 which introduces some features to the 299 | user 300 | - Argument abbreviations 301 | - Subcommand abbreviations 302 | 303 | ** Task 304 | * [JAS-27] - Include JasperReports 5.1.0 305 | 306 | 307 | Release Notes - JasperStarter - Version 1.2.0 308 | ---------------------------------------------- 309 | 310 | This release is mainly due to the new JasperReports library version 5.0.4. 311 | 312 | ** Improvement 313 | * [JAS-25] - Implement command aliases 314 | 315 | ** Task 316 | * [JAS-19] - create an independent configuration bean as replacement for the 317 | parser dependend namspace object 318 | * [JAS-20] - move any call of System.exit() to App.main() 319 | * [JAS-21] - remove obsolete option --keep 320 | * [JAS-26] - Use jasperreports library 5.0.4 321 | 322 | 323 | Release Notes - JasperStarter - Version 1.1.0 324 | ---------------------------------------------- 325 | 326 | JasperStarter is now able to prompt for report parameters. 327 | 328 | ** Bug 329 | * [JAS-5] - Maven site does not create index.html if called directly 330 | * [JAS-6] - Maven site does not generate translation if called directly 331 | * [JAS-11] - Maven site does not create index.html if called via package 332 | * [JAS-16] - Selection of the report locale yields unexpected results in 333 | some cases 334 | 335 | ** Improvement 336 | * [JAS-13] - new parameter type locale to specify report locale independent 337 | from gui locale 338 | 339 | ** New Feature 340 | * [JAS-12] - new option to specify report resources like resource bundles or 341 | icons 342 | * [JAS-14] - New option: prompt for report parameters 343 | * [JAS-17] - New Command: List report parameters 344 | 345 | ** Task 346 | * [JAS-7] - Site translation cs 347 | * [JAS-22] - site translation de 348 | 349 | 350 | -------- 351 | 352 | 1.0.1 [JAS-18] - Unable to save output into Excel format 353 | 354 | 1.0.0 355 | JasperStarter now has commands: pr - process, lp - list printers. 356 | New command: cp - compile, can compile one file or all .jrxml in a 357 | directory. 358 | New input file types for command pr allowed: 359 | jrxml - compiles implicit 360 | jrprint - print, view or export previously filled reports. 361 | New output type: jrprint. This makes --keep obsolete. 362 | New parameter -w writes compiled file to imput dir if jrxml is 363 | processed. 364 | Parameter -t defaults to "none" and can therefore be omited if no 365 | database is needed. 366 | Input file is read once. No temporary files needed anymore. 367 | Setup checks for previous versions and creates menuitems for uninstall 368 | and help. 369 | Setup is available in English, Chinese (Simplified), Czech, French, 370 | Hungarian, German, Polish, Romanian, Thai, Ukrainian. 371 | [JAS-2] - runtime parameter value cannot contain equal sign 372 | Contains JasperReports 5.0.1 373 | German translation for Site/docs 374 | [JAS-4] - java.lang.Integer cannot be cast to java.lang.String 375 | [JAS-8] - java.lang.String cannot be cast to java.lang.Integer 376 | [JAS-9] - Exception in thread "main" java.lang.IllegalArgumentException: 377 | URI has an authority component 378 | 379 | 0.10.0 New report parameter types: double, image (see usage). 380 | New supported export formats: xls, xlsx, csv, ods, pptx, xhtml, xml. 381 | Windows setup available. 382 | --version shows included JasperReports version. 383 | Fixed some minor bugs. 384 | 385 | V 0.9.1 Bugfix release fixed problems with --jdbc-dir option. 386 | 387 | V 0.9.0 First public release 388 | Switched from Commons CLI to argparse4j. 389 | Project documentation in generated site. 390 | README uses markdown syntay, renamed to README.md. 391 | Applied Apache License 2.0 to the software. 392 | JasperStarter now starts via executable files in ./bin. 393 | Windows binary jasperstarter.exe is generated with launch4j. 394 | 395 | V 0.8.0 Switched to maven. 396 | 397 | V 0.7.1 Fixed issue: duplicated option -n 398 | 399 | V 0.7.0 new option --set-report-name to temporary change the reportname when 400 | printing. This is useful if you want to change the printjob name for 401 | printing to a pdf printer like cups-pfd which uses the document name as 402 | part of the pdf name by default. 403 | 404 | V 0.6.0 new options --printer-name --with-print-dialog --list-printers 405 | printername matches .toLowercase().startWith() and spaces can be escaped 406 | by the underline character _. 407 | print dialog and viewer appear in system look an feel. 408 | 409 | V 0.5.0 support for postgres, oracle and generic jdbc 410 | password is no longer a required option except for oracle 411 | jrprint file is stored in system temp dir and deleted after processing 412 | new options --jdbc-dir, --debug, --keep-jrprint 413 | file extension .jasper is added to input if omitted 414 | output can be omitted or can be file or directory 415 | 416 | V 0.4.0 jdbc drivers are loaded from jdbc dir 417 | new parameter: db-type: none, mysql (none provides JREmptyDataSource() 418 | for a non database report) 419 | support for barcode4j 420 | 421 | V 0.3.1 Bugfix: removed jasperreports-javaflow 422 | added barbecue barcode lib 423 | 424 | V 0.3.0 Print preview 425 | nicer help message 426 | package renamed 427 | 428 | V 0.2.0 Print support added 429 | Added exportformats html, odt 430 | Added report parameter type date. 431 | New parameter db-name - database name 432 | 433 | V 0.1.0 First working version 434 | Supports export to PDF, DOCX, RTF. 435 | Simple report parameters of type string and int. 436 | -------------------------------------------------------------------------------- /bin/jasperstarter/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /bin/jasperstarter/NOTICE: -------------------------------------------------------------------------------- 1 | 2 | JasperStarter - Running JasperReports from command line 3 | Copyright 2012, 2013, 2014, 2015 Cenote GmbH 4 | 5 | This product includes software developed at: 6 | 7 | https://sourceforge.net/projects/jasperreports/ 8 | https://github.com/tatsuhiro-t/argparse4j 9 | The Apache Software Foundation (http://www.apache.org/) 10 | 11 | For a detailed view please see dependency report in the documentation. 12 | -------------------------------------------------------------------------------- /bin/jasperstarter/README.md: -------------------------------------------------------------------------------- 1 | 2 | JasperStarter - Running JasperReports from command line 3 | -------------------------------------------------------- 4 | 5 | JasperStarter is an opensource command line launcher and batch compiler for 6 | [JasperReports][]. 7 | 8 | The official homepage is [jasperstater.cenote.de][]. 9 | 10 | It has the following features: 11 | 12 | * Run any JasperReport that needs a jdbc, csv, xml, json, jsonql or empty datasource 13 | * Use with any database for which a jdbc driver is available 14 | * Run reports with subreports 15 | * Execute reports that need runtime parameters. Any parameter whose class has 16 | a string constructor is accepted. Additionally the following types are 17 | supported or have special handlers: 18 | * date, image (see usage), locale 19 | * Optionally prompt for report parameters 20 | * Print directly to system default or given printer 21 | * Optionally show printer dialog to choose printer 22 | * Optionally show printpreview 23 | * Export to file in the following formats: 24 | * pdf, rtf, xls, xlsMeta, xlsx, docx, odt, ods, pptx, csv, csvMeta, html, xhtml, xml, jrprint 25 | * Export multiple formats in one commanding call 26 | * Compile, print and export in one commanding call 27 | * View, print or export previously filled reports (use jrprint file as input) 28 | * Can compile a whole directory of .jrxml files. 29 | * Integrate in non Java applications (for example PHP, Python) 30 | * Binary executable on Windows 31 | * Includes JasperReports so this is the only tool you need to install 32 | * "Diskless" operation using stdin and stdout for input data and output. 33 | 34 | Requirements: 35 | 36 | * Java 1.8 or higher 37 | * A JDBC 2.1 driver for your database 38 | 39 | 40 | ### Quickstart 41 | 42 | * Download JasperStarter from [Sourceforge][]. 43 | * Extract the distribution archive to any directory on your system. 44 | * Add the _./bin_ directory of your installation to your searchpath (on 45 | Windows: invoke setup.exe). 46 | * Put your jdbc drivers in the _./jdbc_ directory of your installation or 47 | use _\--jdbc-dir_ to point to a different directory. 48 | 49 | Invoke JasperStarter with _\-h_ to get an overview: 50 | 51 | $ jasperstarter -h 52 | 53 | Invoke JasperStarter with _process \-h_ to get help on the process command: 54 | 55 | $ jasperstarter process -h 56 | 57 | Example with reportparameters: 58 | 59 | $ jasperstarter pr report.jasper -t mysql -u myuser -f pdf -H myhost \ 60 | -n mydb -o report -p secret -P CustomerNo=10 StartFrom=2012-10-01 61 | 62 | Example with hsql using database type generic: 63 | 64 | $ jasperstarter pr report.jasper -t generic -f pdf -o report -u sa \ 65 | --db-driver org.hsqldb.jdbcDriver \ 66 | --db-url jdbc:hsqldb:hsql://localhost 67 | 68 | For more information take a look in the docs directory of the distibution 69 | archive or read the [Usage][] page online. 70 | 71 | ### Python Integration using public API 72 | 73 | JasperStarter exposes an API which can be used with [jpy][] to 74 | provide direct access from Python: 75 | 76 | # 77 | # Load the JVM. See the jpy docs for details. 78 | # 79 | import jpyutil 80 | jpyutil.init_jvm(jvm_maxmem='512M', jvm_classpath=['.../jasperstarter.jar']) 81 | # 82 | # Load the Java types needed. 83 | # 84 | import jpy 85 | Arrays = jpy.get_type('java.util.Arrays') 86 | File = jpy.get_type('java.io.File') 87 | Report = jpy.get_type('de.cenote.jasperstarter.Report') 88 | Config = jpy.get_type('de.cenote.jasperstarter.Config') 89 | DsType = jpy.get_type('de.cenote.jasperstarter.types.DsType') 90 | # 91 | # Create the JasperStarter configuration. See Config.java for details. 92 | # 93 | config = Config() 94 | config.setInput('jsonql.jrxml') 95 | config.setOutput('contacts.pdf') 96 | config.setDbType(DsType.json) 97 | config.setDataFile(File('contacts.json')) 98 | config.setJsonQuery('contacts.person') 99 | config.setOutputFormats(Arrays.asList([])) 100 | # 101 | # Run the report. See Report.java for details. 102 | # 103 | instance = Report(config, File(config.getInput())) 104 | instance.fill() 105 | instance.exportPdf() 106 | 107 | See the examples/python directory for a fuller example. 108 | 109 | ### Release Notes 110 | 111 | See [Changes] for a history of changes. 112 | 113 | 114 | #### Known Bugs 115 | 116 | For upcoming issues see [Issues][] 117 | 118 | 119 | ### Feedback 120 | 121 | Feedback is always welcome! If you have any questions or proposals, don't 122 | hesitate to write to our [discussion][] forum. 123 | If you found a bug or you are missing a feature, log into our [Issuetracker][] 124 | and create a bug or feature request. 125 | 126 | If you like the software you can write a [review][] :-) 127 | 128 | 129 | ### Development 130 | 131 | The sourcecode is available at [bitbucket.org/cenote/jasperstarter][], the 132 | project website is hosted at [Sourceforge][]. 133 | 134 | JasperStarter is build with [Maven][]. 135 | 136 | On Linux 64 bit the launch4j-maven-plugin may fail. In this case, may you need the following libs in a 32 bit version: 137 | 138 | * z1 139 | * ncurses5 140 | * bz2-1.0 141 | 142 | Install on Ubuntu 14.04 or above: 143 | 144 | $ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 145 | 146 | Install on Fedora 27 or above: 147 | 148 | $sudo dnf install ncurses-compat-libs.i686 149 | 150 | To get a distribution package run: 151 | 152 | $ mvn package -P release 153 | 154 | or if you build from the current default branch you better use: 155 | 156 | $ mvn package -P release,snapshot 157 | 158 | **Attention! You cannot execute** `target/jasperstarter.jar` 159 | **without having it\'s dependencies in** `../lib` ! See **dev** profile below! 160 | 161 | If you want to build the Windows setup.exe, you need to have _nsis_ in your 162 | search path (works on linux too, you can find a compiled release in the 163 | sourceforge download folder _build-tools_ for your convenience) 164 | an add the **windows-setup** profile to your build: 165 | 166 | $ mvn package -P release,windows-setup 167 | 168 | or 169 | 170 | $ mvn package -P release,windows-setup,snapshot 171 | 172 | While developing you may want to have a quicker build. The **dev** profile 173 | excludes some long running reports and the compressed archives. Instead it puts 174 | the build result into _target/jasperstarter-dev-bin_. 175 | 176 | $ mvn package -P dev 177 | 178 | Now you can execute JasperStarter without IDE: 179 | 180 | $ target/jasperstarter-dev-bin/bin/jasperstarter 181 | 182 | or 183 | 184 | $ java -jar target/jasperstarter-dev-bin/lib/jasperstarter.jar 185 | 186 | During development you might want not to be annoyed by tests. So the following 187 | options are useful: 188 | 189 | $ mvn package -P dev -D skipTests 190 | 191 | or 192 | 193 | $ mvn package -P dev -D maven.test.failure.ignore=true 194 | 195 | To run JasperStarter from within your IDE add _\--jdbc-dir jdbc_ to the argument 196 | list of your run configuration. Otherwise you will get an error: 197 | 198 | Error, (...)/JasperStarter/target/classes/jdbc is not a directory! 199 | 200 | Put your jdbc drivers in the _./jdbc_ directory of the project to invoke 201 | JasperStarter from within your IDE to call up a database based report. 202 | 203 | 204 | ### License 205 | 206 | Copyright 2012-2015 Cenote GmbH. 207 | 208 | Licensed under the Apache License, Version 2.0 (the "License"); 209 | you may not use this file except in compliance with the License. 210 | You may obtain a copy of the License at 211 | 212 | http://www.apache.org/licenses/LICENSE-2.0 213 | 214 | Unless required by applicable law or agreed to in writing, software 215 | distributed under the License is distributed on an "AS IS" BASIS, 216 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 217 | See the License for the specific language governing permissions and 218 | limitations under the License. 219 | 220 | [jasperstater.cenote.de]:http://jasperstarter.cenote.de/ 221 | [JasperReports]:http://community.jaspersoft.com/project/jasperreports-library 222 | [Maven]:http://maven.apache.org/ 223 | [Sourceforge]:http://sourceforge.net/projects/jasperstarter/ 224 | [bitbucket.org/cenote/jasperstarter]:http://bitbucket.org/cenote/jasperstarter 225 | [review]:http://sourceforge.net/projects/jasperstarter/reviews 226 | [discussion]:http://sourceforge.net/p/jasperstarter/discussion/ 227 | [Issuetracker]:https://cenote-issues.atlassian.net/browse/JAS 228 | [Usage]:http://jasperstarter.sourceforge.net/usage.html 229 | [Issues]:https://cenote-issues.atlassian.net/browse/JAS 230 | [Changes]:changes.html 231 | [jpy]:https://github.com/bcdev/jpy -------------------------------------------------------------------------------- /bin/jasperstarter/bin/jasperstarter: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright 2012 Cenote GmbH. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | ## detect home folder 18 | if(test -L "$0") then 19 | auxlink=`ls -l "$0" | sed 's/^[^>]*-> //g'` 20 | HOME_FOLDER=`dirname "$auxlink"`/.. 21 | else 22 | HOME_FOLDER=`dirname "$0"`/.. 23 | fi 24 | 25 | #SCRIPTPATH="$(dirname $0)" 26 | java -jar "$HOME_FOLDER/lib/jasperstarter.jar" "$@" -------------------------------------------------------------------------------- /bin/jasperstarter/bin/jasperstarter.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/bin/jasperstarter.exe -------------------------------------------------------------------------------- /bin/jasperstarter/jdbc/README: -------------------------------------------------------------------------------- 1 | This is the jdbc drivers directory. 2 | All jar files in this directory are added to the classpath. 3 | -------------------------------------------------------------------------------- /bin/jasperstarter/jdbc/mysql-connector-java-5.1.48.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/jdbc/mysql-connector-java-5.1.48.jar -------------------------------------------------------------------------------- /bin/jasperstarter/jdbc/postgresql-42.2.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/jdbc/postgresql-42.2.9.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/ant-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/ant-1.7.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/ant-launcher-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/ant-launcher-1.7.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/antlr-2.7.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/antlr-2.7.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/antlr-3.0b5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/antlr-3.0b5.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/argparse4j-0.5.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/argparse4j-0.5.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/avalon-framework-impl-4.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/avalon-framework-impl-4.2.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/barbecue-1.5-beta1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/barbecue-1.5-beta1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/barcode4j-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/barcode4j-2.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-anim-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-anim-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-awt-util-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-awt-util-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-bridge-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-bridge-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-constants-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-constants-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-css-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-css-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-dom-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-dom-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-ext-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-ext-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-gvt-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-gvt-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-i18n-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-i18n-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-parser-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-parser-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-script-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-script-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-svg-dom-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-svg-dom-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-svggen-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-svggen-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-util-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-util-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-xml-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/batik-xml-1.9.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/bcprov-jdk15on-1.52.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/bcprov-jdk15on-1.52.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/castor-core-1.3.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/castor-core-1.3.3.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/castor-xml-1.3.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/castor-xml-1.3.3.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-beanutils-1.9.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/commons-beanutils-1.9.3.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-cli-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/commons-cli-1.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-codec-1.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/commons-codec-1.10.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-collections-3.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/commons-collections-3.2.2.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-collections4-4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/commons-collections4-4.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-digester-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/commons-digester-2.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-io-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/commons-io-2.5.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-lang-2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/commons-lang-2.6.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-logging-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/commons-logging-1.1.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/ecj-4.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/ecj-4.4.2.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/groovy-all-2.4.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/groovy-all-2.4.12.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/icu4j-57.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/icu4j-57.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/itext-2.1.7.js6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/itext-2.1.7.js6.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jackson-annotations-2.9.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jackson-annotations-2.9.5.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jackson-core-2.9.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jackson-core-2.9.5.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jackson-databind-2.9.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jackson-databind-2.9.5.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperreports-6.7.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jasperreports-6.7.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperreports-chart-customizers-6.7.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jasperreports-chart-customizers-6.7.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperreports-chart-themes-6.7.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jasperreports-chart-themes-6.7.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperreports-fonts-6.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jasperreports-fonts-6.0.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperreports-functions-6.7.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jasperreports-functions-6.7.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperstarter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jasperstarter.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/javax.inject-1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/javax.inject-1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jcalendar-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jcalendar-1.4.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jcommon-1.0.23.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jcommon-1.0.23.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jfreechart-1.0.19.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jfreechart-1.0.19.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/joda-time-2.9.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/joda-time-2.9.9.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jython-2.7.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/jython-2.7.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/log4j-1.2.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/log4j-1.2.17.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/poi-3.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/poi-3.17.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/rhino-1.7.7.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/rhino-1.7.7.2.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/serializer-2.7.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/serializer-2.7.2.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/servlet-api-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/servlet-api-2.5.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/spring-beans-4.3.21.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/spring-beans-4.3.21.RELEASE.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/spring-core-4.3.21.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/spring-core-4.3.21.RELEASE.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/spring-expression-4.3.21.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/spring-expression-4.3.21.RELEASE.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/stax-1.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/stax-1.2.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/stax-api-1.0-2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/stax-api-1.0-2.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/stax-api-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/stax-api-1.0.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/stringtemplate-3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/stringtemplate-3.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/xalan-2.7.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/xalan-2.7.2.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/xml-apis-1.3.04.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/xml-apis-1.3.04.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/xml-apis-ext-1.3.04.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/xml-apis-ext-1.3.04.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/xmlgraphics-commons-2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/bin/jasperstarter/lib/xmlgraphics-commons-2.2.jar -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "geekcom/phpjasper", 3 | "description": "A PHP report generator", 4 | "license": "MIT", 5 | "keywords": [ 6 | "reports", 7 | "php-reports", 8 | "pdf" 9 | ], 10 | "authors": [ 11 | { 12 | "name": "Daniel Rodrigues Lima", 13 | "email": "geekcom@php.net", 14 | "role": "lead" 15 | } 16 | ], 17 | "minimum-stability": "stable", 18 | "require": { 19 | "php": "^7.2|^8.0" 20 | }, 21 | "require-dev": { 22 | "phpunit/phpunit": "^8.4|^9.4", 23 | "php-coveralls/php-coveralls": "^2.2", 24 | "squizlabs/php_codesniffer": "*", 25 | "phpstan/phpstan": "^0.12.5" 26 | }, 27 | "autoload": { 28 | "psr-4": { 29 | "PHPJasper\\": "src/" 30 | } 31 | }, 32 | "autoload-dev": { 33 | "psr-4": { 34 | "PHPJasper\\Test\\": "tests/" 35 | } 36 | }, 37 | "scripts": { 38 | "phpcs": "phpcs --standard=PSR12 -n src", 39 | "phpstan": "phpstan analyse src --level 0", 40 | "phpcbf": "phpcbf --standard=PSR12 -n src", 41 | "unit": "phpunit --coverage-clover ./tests/log/clover.xml --colors=always", 42 | "testdox": "phpunit --testdox", 43 | "test": [ 44 | "@phpcs", 45 | "@phpstan", 46 | "@unit" 47 | ] 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | php: 4 | image: geekcom/phpjasper:latest 5 | container_name: phpjasper 6 | volumes: 7 | - .:/var/www/app 8 | tty: true 9 | -------------------------------------------------------------------------------- /docs/images/phpjasper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHPJasper/phpjasper/908c58b3877ffb7e9fc055d2fc1d59e167e89331/docs/images/phpjasper.png -------------------------------------------------------------------------------- /docs/pt_BR/LEIA-ME_pt_BR.md: -------------------------------------------------------------------------------- 1 | ![PHPJasper logo](../images/phpjasper.png) 2 | 3 | # PHPJasper 4 | 5 | _Gerador de relatórios PHP_ 6 | 7 | [![Build Status](https://api.travis-ci.com/PHPJasper/phpjasper.svg?branch=master)](https://app.travis-ci.com/github/PHPJasper/phpjasper) 8 | [![Coverage Status](https://coveralls.io/repos/github/PHPJasper/phpjasper/badge.svg?branch=master)](https://coveralls.io/github/PHPJasper/phpjasper?branch=master) 9 | [![Latest Stable Version](https://poser.pugx.org/geekcom/phpjasper/v/stable)](https://packagist.org/packages/geekcom/phpjasper) 10 | [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%207.2-blue.svg?style=flat-square)](https://php.net/) 11 | [![Total Downloads](https://poser.pugx.org/geekcom/phpjasper/downloads)](https://packagist.org/packages/geekcom/phpjasper) 12 | [![License](https://poser.pugx.org/geekcom/phpjasper/license)](https://packagist.org/packages/geekcom/phpjasper) 13 | [![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan) 14 | 15 | ### Documentação 16 | [![Language-en_US](https://img.shields.io/badge/en__US-100%25-green.svg)](https://github.com/PHPJasper/phpjasper/blob/master/README.md) 17 | 18 | > ### Por favor, considere **[fazer uma doação](https://nubank.com.br/pagar/518o5/zVBzxd00Sb)**, apoie nossas atividades 19 | 20 | ### Sobre a biblioteca 21 | 22 | PHPJasper é a solução perfeita para compilar e processar relatórios Jasper (.jrxml & .jasper) com PHP, ou seja, gerar relatórios com PHP. 23 | 24 | #### Nosso canal no discord 25 | https://discord.gg/7FpDnQ 26 | 27 | **Notas:** 28 | * PHPJasper pode ser usado independente de seu Framework 29 | * Se você está usando uma versão menor que PHP 7.0 veja: [v1.16](https://github.com/PHPJasper/phpjasper/releases/tag/v1.16) 30 | * [Aqui](https://github.com/PHPJasper/examples) tem vários exemplos de como usar PHPJasper 31 | 32 | ### Por quê preciso do PHPJasper? 33 | 34 | Alguma vez você precisou de um relatório simples ou complexo em PHP para seu sistema web? 35 | 36 | Eu já precisei e fui em busca de algumas soluções, a maioria delas é complexa e você precisa escrever *HTML* + *CSS* para gerar um *PDF*, isso não faz sentido, além de ser muito trabalhoso :) 37 | 38 | Apresento para vocês **JasperReports** a melhor solução open source que existe para relatórios. 39 | 40 | ### O que eu posso fazer com isso? 41 | 42 | **Texto extraido do site JasperSoft:** 43 | 44 | > A biblioteca JasperReports é o mecanismo de geração de relatórios de código aberto mais popular do mundo. É inteiramente escrito em Java e é capaz de usar dados provenientes de qualquer tipo de fonte de dados e gerar documentos perfeitos que podem ser visualizado, impresso ou exportado em uma variedade de formatos de documentos, incluindo HTML, PDF, Excel, OpenOffice e Word . 45 | 46 | *Exemplos do que você pode fazer:* 47 | 48 | * Faturas 49 | * Relatórios 50 | * Listas 51 | 52 | ## Requisitos 53 | 54 | * PHP 7.2 em diante 55 | * Java JDK 1.8 56 | 57 | ## Opcional 58 | 59 | * Qualquer driver jdbc (MySQL, PostgreSQL, MSSQL...), para ser usado deve ser copiado para a pasta `bin/jasperstarter/jdbc` 60 | * Incluímos o [MySQL connector](http://dev.mysql.com/downloads/connector/j/) (v5.1.48) na pasta `bin/jasperstarter/jdbc` 61 | * Incluímos também o [PostgreSQL](https://jdbc.postgresql.org/) (42.2.9) na pasta `bin/jasperstarter/jdbc` 62 | * [Microsoft JDBC Drivers](https://www.microsoft.com/en-US/download/details.aspx?id=11774) (se você pretende usar esse tipo de banco de dados) 63 | * [Jaspersoft Studio](http://community.jaspersoft.com/project/jaspersoft-studio) (para escrever e compilar seus relatórios) 64 | 65 | ## Instalando a biblioteca PHPJasper 66 | 67 | Instale o [Composer](http://getcomposer.org), e rode o comando: 68 | 69 | ``` 70 | composer require geekcom/phpjasper 71 | ``` 72 | 73 | Ou crie um arquivo 'composer.json' e adicione o trecho: 74 | 75 | ```json 76 | { 77 | "require": { 78 | "geekcom/phpjasper": "^3.2.0" 79 | } 80 | } 81 | ``` 82 | 83 | E execute o comando: 84 | 85 | composer install 86 | 87 | é isso, você tem a biblioteca instalada e pronta para uso. 88 | 89 | ---------------------------------------------------------------------------------------------------------------------------- 90 | ## PHPJasper com Docker 91 | 92 | Com o Docker CE e o docker-compose instalados basta executar os comandos: 93 | 94 | * `docker-compose up -d` 95 | * `docker exec -it phpjasper composer install` 96 | 97 | Para rodar os testes dentro do container execute: 98 | 99 | * `docker exec -it phpjasper sudo composer test` ou 100 | * `docker exec -it phpjasper sudo composer testdox` 101 | 102 | Para ver o coverage basta executar o arquivo: `tests/log/report/index.html` 103 | 104 | _Ajude-nos escrevendo novos testes, faça um fork_ :) 105 | 106 | ---------------------------------------------------------------------------------------------------------------------------- 107 | 108 | ## Exemplos 109 | 110 | ### *Hello World* PHPJasper. 111 | 112 | Vá para o diretório de exemplos na raiz do repositório (`vendor/geekcom/phpjasper/examples`). 113 | Abra o arquivo `hello_world.jrxml` com o JasperStudio ou seu editor favorito e dê uma olhada no código. 114 | 115 | #### Compilando 116 | 117 | Primeiro precisamos compilar o arquivo com a extensão `.JRXML` em um arquivo binário do tipo `.JASPER` 118 | 119 | **Nota 1:** Caso você não queira usar o *Jaspersoft Studio*. É possivel compilar o seu arquivo .jrxml da seguinte forma: 120 | 121 | ```php 122 | 123 | require __DIR__ . '/vendor/autoload.php'; 124 | 125 | use PHPJasper\PHPJasper; 126 | 127 | $input = __DIR__ . '/vendor/geekcom/phpjasper/examples/hello_world.jrxml'; 128 | 129 | $jasper = new PHPJasper; 130 | $jasper->compile($input)->execute(); 131 | ``` 132 | 133 | Esse comando compila o arquivo fonte `hello_world.jrxml` em um arquivo binário `hello_world.jasper`. 134 | 135 | #### Processando 136 | 137 | Agora vamos processar o nosso relatório que foi compilado acima: 138 | 139 | ```php 140 | require __DIR__ . '/vendor/autoload.php'; 141 | 142 | use PHPJasper\PHPJasper; 143 | 144 | $input = __DIR__ . '/vendor/geekcom/phpjasper/examples/hello_world.jasper'; 145 | $output = __DIR__ . '/vendor/geekcom/phpjasper/examples'; 146 | $options = [ 147 | 'format' => ['pdf', 'rtf'] 148 | ]; 149 | 150 | $jasper = new PHPJasper; 151 | 152 | $jasper->process( 153 | $input, 154 | $output, 155 | $options 156 | )->execute(); 157 | ``` 158 | 159 | Agora olhe a pasta **/examples** :) Ótimo trabalho? Você tem 2 arquivos, `hello_world.pdf` e `hello_world.rtf`. 160 | 161 | #### Listando parâmetros 162 | 163 | Como consultar o arquivo jrxml para examinar os parâmetros disponíveis no relatório: 164 | 165 | ```php 166 | 167 | require __DIR__ . '/vendor/autoload.php'; 168 | 169 | use PHPJasper\PHPJasper; 170 | 171 | $input = __DIR__ . '/vendor/geekcom/phpjasper/examples/hello_world_params.jrxml'; 172 | 173 | $jasper = new PHPJasper; 174 | $output = $jasper->listParameters($input)->execute(); 175 | 176 | foreach($output as $parameter_description) 177 | print $parameter_description . '
';
178 | ```
179 | 
180 | ### Relatórios a partir de um banco de dados
181 | 
182 | Adicione os parâmetros específicos para conexão com seu banco de dados: MYSQL, POSTGRES ou MSSQL:
183 | 
184 | ```php
185 | require __DIR__ . '/vendor/autoload.php';
186 | 
187 | use PHPJasper\PHPJasper;    
188 | 
189 | $input = '/your_input_path/your_report.jasper';   
190 | $output = '/your_output_path';
191 | $options = [
192 |     'format' => ['pdf'],
193 |     'locale' => 'pt_BR',
194 |     'params' => [],
195 |     'db_connection' => [
196 |         'driver' => 'postgres',
197 |         'username' => 'DB_USERNAME',
198 |         'password' => 'DB_PASSWORD',
199 |         'host' => 'DB_HOST',
200 |         'database' => 'DB_DATABASE',
201 |         'port' => '5432'
202 |     ]
203 | ];
204 | 
205 | $jasper = new PHPJasper;
206 | 
207 | $jasper->process(
208 |         $input,
209 |         $output,
210 |         $options
211 | )->execute();
212 | ```
213 | 
214 | **Nota 2:**
215 | 
216 | Para a lista completa de idiomas suportados veja o link [Supported Locales](http://www.oracle.com/technetwork/java/javase/java8locales-2095355.html)
217 | 
218 | ### Relatórios com banco de dados MSSQL
219 | 
220 | ```php
221 | require __DIR__ . '/vendor/autoload.php';
222 | 
223 | use PHPJasper\PHPJasper;
224 | 
225 | $input = '/your_input_path/your_report.jasper or .jrxml';   
226 | $output = '/your_output_path';
227 | $jdbc_dir = __DIR__ . '/vendor/geekcom/phpjasper/bin/jaspertarter/jdbc';
228 | $options = [
229 |     'format' => ['pdf'],
230 |     'locale' => 'pt_BR',
231 |     'params' => [],
232 |     'db_connection' => [
233 |         'driver' => 'generic',
234 |         'host' => '127.0.0.1',
235 |         'port' => '1433',
236 |         'database' => 'DataBaseName',
237 |         'username' => 'UserName',
238 |         'password' => 'password',
239 |         'jdbc_driver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
240 |         'jdbc_url' => 'jdbc:sqlserver://127.0.0.1:1433;databaseName=Teste',
241 |         'jdbc_dir' => $jdbc_dir
242 |     ]
243 | ];
244 | 
245 | $jasper = new PHPJasper;
246 | 
247 | $jasper->process(
248 |         $input,
249 |         $output,
250 |         $options
251 |     )->execute();
252 | ```
253 | 
254 | ### Relatórios a partir de um arquivo XML
255 | 
256 | ```php
257 | require __DIR__ . '/vendor/autoload.php';
258 | 
259 | use PHPJasper\PHPJasper;
260 | 
261 | $input = '/your_input_path/your_report.jasper';   
262 | $output = '/your_output_path';
263 | $data_file = __DIR__ . '/your_data_files_path/your_xml_file.xml';
264 | $options = [
265 |     'format' => ['pdf'],
266 |     'params' => [],
267 |     'locale' => 'pt_BR',
268 |     'db_connection' => [
269 |         'driver' => 'xml',
270 |         'data_file' => $data_file,
271 |         'xml_xpath' => '/your_xml_xpath'
272 |     ]
273 | ];
274 | 
275 | $jasper = new PHPJasper;
276 | 
277 | $jasper->process(
278 |     $input,
279 |     $output,
280 |     $options
281 | )->execute();
282 | ```
283 | 
284 | ### Relatórios a partir de um arquivo JSON
285 | 
286 | ```php
287 | require __DIR__ . '/vendor/autoload.php';
288 | 
289 | use PHPJasper\PHPJasper;
290 | 
291 | $input = '/your_input_path/your_report.jasper';   
292 | $output = '/your_output_path';
293 | 
294 | $data_file = __DIR__ . '/your_data_files_path/your_json_file.json';
295 | $options = [
296 |     'format' => ['pdf'],
297 |     'params' => [],
298 |     'locale' => 'pt_BR',
299 |     'db_connection' => [
300 |         'driver' => 'json',
301 |         'data_file' => $data_file,
302 |         'json_query' => 'your_json_query'
303 |     ]
304 | ];
305 | 
306 | $jasper = new PHPJasper;
307 | 
308 | $jasper->process(
309 |     $input,
310 |     $output,
311 |     $options
312 | )->execute();
313 | ```
314 | 
315 | ## Performance
316 | 
317 | Depende da complexidade do seu relatório.
318 | 
319 | ## Agradecimentos
320 | 
321 | [Cenote GmbH](http://www.cenote.de/) pelo [JasperStarter](https://bitbucket.org/cenote/jasperstarter/) tool.
322 | 
323 | [JetBrains](https://www.jetbrains.com/) pelo [PhpStorm](https://www.jetbrains.com/phpstorm/) e seu grande apoio.
324 | 
325 | 
326 | ## [Dúvidas?](https://github.com/PHPJasper/phpjasper/issues)
327 | 
328 | Abra uma [Issue](https://github.com/PHPJasper/phpjasper/issues) ou procure por Issues antigas
329 | 
330 | 
331 | ## [Licença](https://github.com/PHPJasper/phpjasper/blob/master/LICENSE)
332 | 
333 | MIT
334 | 
335 | ## [Contribuição](https://github.com/PHPJasper/phpjasper/blob/master/CONTRIBUTING.md)
336 | 
337 | Contribua com a comunidade PHP, faça um fork !!
338 | 


--------------------------------------------------------------------------------
/examples/.gitignore:
--------------------------------------------------------------------------------
1 | hello_world.jasper
2 | hello_world.pdf


--------------------------------------------------------------------------------
/examples/CancelAck.jrxml:
--------------------------------------------------------------------------------
  1 | 
  2 | 
  3 | 	
  4 | 	
  5 | 	
  6 | 	
  7 | 	
  8 | 		
  9 | 	
 10 | 	
 11 | 		
 12 | 	
 13 | 	
 14 | 		
 15 | 	
 16 | 	
 17 | 		
 18 | 	
 19 | 	
 20 | 		
 21 | 	
 22 | 	
 23 | 		
 24 | 	
 25 | 	
 26 | 		
 27 | 	
 28 | 	
 29 | 		
 30 | 	
 31 | 	
 32 | 		
 33 | 	
 34 | 	
 35 | 		
 36 | 			
 37 | 				
 38 | 					
 39 | 					
 40 | 				
 41 | 				
 42 | 					
 43 | 				
 44 | 				
 45 | 			
 46 | 			
 47 | 				
 48 | 				
 49 | 					
 50 | 				
 51 | 				
 52 | 			
 53 | 			
 54 | 				
 55 | 				
 56 | 					
 57 | 				
 58 | 				
 59 | 			
 60 | 			
 61 | 				
 62 | 				
 63 | 					
 64 | 				
 65 | 				
 66 | 			
 67 | 			
 68 | 				
 69 | 				
 70 | 					
 71 | 				
 72 | 				
 73 | 			
 74 | 			
 75 | 				
 76 | 				
 77 | 					
 78 | 				
 79 | 				
 80 | 			
 81 | 			
 82 | 				
 83 | 				
 84 | 					
 85 | 				
 86 | 				
 87 | 			
 88 | 			
 89 | 				
 90 | 				
 91 | 					
 92 | 				
 93 | 				
 94 | 			
 95 | 			
 96 | 				
 97 | 				
 98 | 					
 99 | 				
100 | 				
101 | 			
102 | 			
103 | 				
104 | 				
105 | 					
106 | 				
107 | 				
108 | 			
109 | 		
110 | 	
111 | 	
112 | 		
113 | 			
114 | 			
115 | 			
116 | 				
117 | 					
118 | 					
119 | 				
120 | 				
121 | 					
122 | 					
123 | 					
124 | 					
125 | 				
126 | 				
127 | 					
128 | 				
129 | 				
130 | 			
131 | 			
132 | 				
133 | 					
134 | 				
135 | 				
136 | 					
137 | 					
138 | 					
139 | 					
140 | 				
141 | 				
142 | 					
143 | 				
144 | 				
145 | 			
146 | 		
147 | 	
148 | 	
149 | 		
150 | 			
151 | 				
152 | 					
153 | 					
154 | 				
155 | 				
156 | 					
157 | 					
158 | 					
159 | 					
160 | 				
161 | 				
162 | 					
163 | 				
164 | 				
165 | 			
166 | 			
167 | 				
168 | 					
169 | 					
170 | 				
171 | 				
172 | 					
173 | 					
174 | 					
175 | 					
176 | 				
177 | 				
178 | 					
179 | 				
180 | 				
181 | 			
182 | 		
183 | 	
184 | 	
185 | 		
186 | 			
187 | 				
188 | 					
189 | 					
190 | 				
191 | 				
192 | 				
193 | 			
194 | 			
195 | 				
196 | 					
197 | 				
198 | 				
199 | 				
200 | 			
201 | 			
202 | 				
203 | 				
204 | 					
205 | 				
206 | 				
207 | 			
208 | 			
209 | 				
210 | 				
211 | 					
212 | 				
213 | 				
214 | 			
215 | 		
216 | 	
217 | 
218 | 


--------------------------------------------------------------------------------
/examples/CancelAck.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |     
 4 |         1361E3F3-B493-4F5C-9A2D-67C7CC151907201
 5 |         136F0E14-3C92-4506-991D-0DB2FB45E0A9201
 6 |         13741D6D-574A-458E-8112-4943929D3DFA201
 7 |         137A252B-4F8B-48CB-A5FE-219FE149CC1F201
 8 |         138665F0-3935-4880-B125-3C0D03218CA8201
 9 |     
10 |     cqOD3A20ku9vHI3MGI18HkSsljYcURr6fSjyk9I+MRghG9T2/EXpiqZahCSYCBr0JwFV/rCWbP6kvdk7eYGerg==
11 | 


--------------------------------------------------------------------------------
/examples/contacts.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "contacts": {
 3 |     "person": [
 4 |       {
 5 |         "name": "ETHAN",
 6 |         "street": "Street 1",
 7 |         "city": "Fairfax",
 8 |         "phone": "+1 (415) 111-1111"
 9 |       },
10 |       {
11 |         "name": "CALEB",
12 |         "street": "Street 2",
13 |         "city": "San Francisco",
14 |         "phone": "+1 (415) 222-2222"
15 |       },
16 |       {
17 |         "name": "WILLIAM",
18 |         "street": "Street 2",
19 |         "city": "Paradise City",
20 |         "phone": "+1 (415) 333-3333"
21 |       }
22 |     ]
23 |   }
24 | }


--------------------------------------------------------------------------------
/examples/hello_world.jrxml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 	
 5 | 	
 6 | 	
 7 | 	
 8 | 		
 9 | 	
10 | 	
11 | 		<band height="72">
12 | 			<frame>
13 | 				<reportElement mode="Opaque" x="-20" y="-20" width="595" height="92" backcolor="#006699" uuid="3501dac6-be9b-47b1-bf09-8b25fbc6c79f"/>
14 | 				<staticText>
15 | 					<reportElement x="20" y="20" width="349" height="45" forecolor="#FFFFFF" uuid="2464c9ca-82a1-48c9-87ea-b68192294c4a"/>
16 | 					<textElement>
17 | 						<font fontName="Arial" size="34" isBold="true"/>
18 | 					</textElement>
19 | 					<text><![CDATA[PHPjasper Test]]></text>
20 | 				</staticText>
21 | 			</frame>
22 | 		</band>
23 | 	
24 | 	
25 | 		
26 | 			
27 | 				
28 | 			
29 | 			
30 | 				
31 | 				
32 | 					
33 | 				
34 | 				
35 | 			
36 | 		
37 | 	
38 | 	
39 | 		
40 | 	
41 | 	
42 | 		
43 | 			
44 | 				
45 | 				
46 | 					
47 | 				
48 | 				
49 | 			
50 | 		
51 | 	
52 | 	
53 | 		
54 | 	
55 | 	
56 | 		
57 | 			
58 | 				
59 | 				
60 | 				
61 | 			
62 | 			
63 | 				
64 | 				
65 | 			
66 | 			
67 | 				
68 | 				
69 | 			
70 | 		
71 | 	
72 | 	
73 | 		
74 | 	
75 | 
76 | 


--------------------------------------------------------------------------------
/examples/hello_world_params.jrxml:
--------------------------------------------------------------------------------
  1 | 
  2 | 
  3 | 	
  4 | 	
  5 | 	
  6 | 	
  7 | 	
  8 | 	
  9 | 	
 10 | 		
 11 | 	
 12 | 	
 13 | 		
 14 | 	
 15 | 	
 16 | 		<band height="72">
 17 | 			<frame>
 18 | 				<reportElement uuid="5347bff5-dbb0-4672-b148-036cdd75c8c7" mode="Opaque" x="-20" y="-20" width="595" height="92" backcolor="#006699"/>
 19 | 				<staticText>
 20 | 					<reportElement uuid="8b0fa6d5-c0c6-4530-95bb-93c3b34d2fca" x="20" y="20" width="234" height="43" forecolor="#FFFFFF"/>
 21 | 					<textElement>
 22 | 						<font size="34" isBold="true"/>
 23 | 					</textElement>
 24 | 					<text><![CDATA[JasperStarter]]></text>
 25 | 				</staticText>
 26 | 				<staticText>
 27 | 					<reportElement uuid="84c20b7b-2750-44e1-8f6e-87cc755158c2" x="298" y="43" width="277" height="20" forecolor="#FFFFFF"/>
 28 | 					<textElement textAlignment="Right">
 29 | 						<font size="14" isBold="false"/>
 30 | 					</textElement>
 31 | 					<text><![CDATA[Report with parameters]]></text>
 32 | 				</staticText>
 33 | 			</frame>
 34 | 		</band>
 35 | 	
 36 | 	
 37 | 		
 38 | 	
 39 | 	
 40 | 		
 41 | 			
 42 | 				
 43 | 			
 44 | 		
 45 | 	
 46 | 	
 47 | 		
 48 | 			
 49 | 				
 50 | 				
 51 | 					
 52 | 				
 53 | 				
 54 | 			
 55 | 			
 56 | 				
 57 | 				
 58 | 					
 59 | 				
 60 | 				
 61 | 			
 62 | 			
 63 | 				
 64 | 				
 65 | 					
 66 | 				
 67 | 				
 68 | 			
 69 | 			
 70 | 				
 71 | 				
 72 | 					
 73 | 				
 74 | 				
 75 | 			
 76 | 			
 77 | 				
 78 | 				
 79 | 					
 80 | 				
 81 | 				
 82 | 			
 83 | 			
 84 | 				
 85 | 				
 86 | 					
 87 | 				
 88 | 				
 89 | 			
 90 | 			
 91 | 				
 92 | 				
 93 | 					
 94 | 				
 95 | 				
 96 | 			
 97 | 			
 98 | 				
 99 | 				
100 | 			
101 | 		
102 | 	
103 | 	
104 | 		
105 | 	
106 | 	
107 | 		
108 | 			
109 | 				
110 | 				
111 | 				
112 | 			
113 | 			
114 | 				
115 | 				
116 | 				
117 | 			
118 | 			
119 | 				
120 | 				
121 | 				
122 | 			
123 | 		
124 | 	
125 | 	
126 | 		
127 | 	
128 | 
129 | 


--------------------------------------------------------------------------------
/examples/json.jrxml:
--------------------------------------------------------------------------------
  1 | 
  2 | 
  3 | 
  4 | 
  5 | 	
  6 | 	
  7 | 	
  8 | 	
  9 | 	
 10 | 		
 11 | 	
 12 | 	
 13 | 		
 14 | 	
 15 | 	
 16 | 		
 17 | 	
 18 | 	
 19 | 		
 20 | 	
 21 | 	
 22 | 		
 23 | 	
 24 | 	
 25 | 		
 26 | 	
 27 | 	
 28 | 		<band height="72">
 29 | 			<frame>
 30 | 				<reportElement mode="Opaque" x="-20" y="-20" width="595" height="92" backcolor="#006699" uuid="d6b7d5aa-5c6b-4106-9569-b0014b63e753"/>
 31 | 				<staticText>
 32 | 					<reportElement x="20" y="20" width="267" height="43" forecolor="#FFFFFF" uuid="2932e85f-a2d7-40d5-9dad-0b5ea669ad15"/>
 33 | 					<textElement>
 34 | 						<font size="34" isBold="true"/>
 35 | 					</textElement>
 36 | 					<text><![CDATA[JasperStarter]]></text>
 37 | 				</staticText>
 38 | 				<staticText>
 39 | 					<reportElement x="298" y="43" width="277" height="20" forecolor="#FFFFFF" uuid="04e1a0ed-0b0f-41d4-93e9-792d4fd37d28"/>
 40 | 					<textElement textAlignment="Right">
 41 | 						<font size="14" isBold="false"/>
 42 | 					</textElement>
 43 | 					<text><![CDATA[Report with JSON Datasource]]></text>
 44 | 				</staticText>
 45 | 			</frame>
 46 | 		</band>
 47 | 	
 48 | 	
 49 | 		
 50 | 	
 51 | 	
 52 | 		
 53 | 			
 54 | 				
 55 | 			
 56 | 			
 57 | 				
 58 | 				
 59 | 					
 60 | 				
 61 | 				
 62 | 			
 63 | 			
 64 | 				
 65 | 				
 66 | 					
 67 | 				
 68 | 				
 69 | 			
 70 | 			
 71 | 				
 72 | 				
 73 | 					
 74 | 				
 75 | 				
 76 | 			
 77 | 			
 78 | 				
 79 | 				
 80 | 					
 81 | 				
 82 | 				
 83 | 			
 84 | 		
 85 | 	
 86 | 	
 87 | 		
 88 | 			
 89 | 				
 90 | 				
 91 | 			
 92 | 			
 93 | 				
 94 | 				
 95 | 			
 96 | 			
 97 | 				
 98 | 				
 99 | 			
100 | 			
101 | 				
102 | 				
103 | 			
104 | 		
105 | 	
106 | 	
107 | 		
108 | 	
109 | 	
110 | 		
111 | 			
112 | 				
113 | 				
114 | 				
115 | 			
116 | 			
117 | 				
118 | 				
119 | 			
120 | 			
121 | 				
122 | 				
123 | 			
124 | 		
125 | 	
126 | 	
127 | 		
128 | 	
129 | 
130 | 


--------------------------------------------------------------------------------
/phpcs.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |     
 4 |     
 5 |     
 6 |     
 7 |     
 8 | 
 9 |     
10 | 
11 |     ^/tests/*
12 | 
13 |     src
14 | 
15 |     
16 | 


--------------------------------------------------------------------------------
/phpunit.xml.dist:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |   
 4 |     
 5 |       ./src/
 6 |     
 7 |     
 8 |       
 9 |       
10 |     
11 |   
12 |   
13 |     
14 |       ./tests/
15 |     
16 |   
17 |   
18 | 
19 | 


--------------------------------------------------------------------------------
/src/Exception/ErrorCommandExecutable.php:
--------------------------------------------------------------------------------
 1 | executable = 'jasperstarter';
 77 |         $this->pathExecutable = $pathExecutable ?? __DIR__ . '/../bin/jasperstarter/bin';
 78 |         $this->windows = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? true : false;
 79 |     }
 80 | 
 81 |     /**
 82 |      * @return string
 83 |      */
 84 |     private function checkServer()
 85 |     {
 86 |         return $this->command = $this->windows ? $this->executable : './' . $this->executable;
 87 |     }
 88 | 
 89 |     /**
 90 |      * @param string $input
 91 |      * @param string $output optional
 92 |      * @return $this
 93 |      * @throws Exception\InvalidInputFile
 94 |      */
 95 |     public function compile(string $input, string $output = '')
 96 |     {
 97 |         if (!is_file($input)) {
 98 |             throw new Exception\InvalidInputFile();
 99 |         }
100 | 
101 |         $this->command = $this->checkServer();
102 |         $this->command .= ' compile ';
103 |         $this->command .= '"' . realpath($input) . '"';
104 | 
105 |         if (!empty($output)) {
106 |             $this->command .= ' -o ' . "\"$output\"";
107 |         }
108 | 
109 |         return $this;
110 |     }
111 | 
112 |     /**
113 |      * @param string $input
114 |      * @param string $output
115 |      * @param array $options
116 |      * @return $this
117 |      * @throws Exception\InvalidInputFile
118 |      * @throws Exception\InvalidFormat
119 |      */
120 |     public function process(string $input, string $output, array $options = [])
121 |     {
122 |         $options = $this->parseProcessOptions($options);
123 | 
124 |         if (!$input) {
125 |             throw new Exception\InvalidInputFile();
126 |         }
127 | 
128 |         $this->validateFormat($options['format']);
129 | 
130 |         $this->command = $this->checkServer();
131 | 
132 |         if ($options['locale']) {
133 |             $this->command .= " --locale {$options['locale']}";
134 |         }
135 | 
136 |         $this->command .= ' process ';
137 |         $this->command .= "\"$input\"";
138 |         $this->command .= ' -o ' . "\"$output\"";
139 | 
140 |         $this->command .= ' -f ' . join(' ', $options['format']);
141 | 
142 |         if ($options['params']) {
143 |             $this->command .= ' -P ';
144 |             foreach ($options['params'] as $key => $value) {
145 |                 $this->command .= " " . $key . '="' . $value . '" ' . " ";
146 |             }
147 |         }
148 | 
149 |         if ($options['db_connection']) {
150 |             $mapDbParams = [
151 |                 'driver' => '-t',
152 |                 'username' => '-u',
153 |                 'password' => '-p',
154 |                 'host' => '-H',
155 |                 'database' => '-n',
156 |                 'port' => '--db-port',
157 |                 'jdbc_driver' => '--db-driver',
158 |                 'jdbc_url' => '--db-url',
159 |                 'jdbc_dir' => '--jdbc-dir',
160 |                 'db_sid' => '--db-sid',
161 |                 'xml_xpath' => '--xml-xpath',
162 |                 'data_file' => '--data-file',
163 |                 'json_query' => '--json-query'
164 |             ];
165 | 
166 |             foreach ($options['db_connection'] as $key => $value) {
167 |                 $this->command .= " {$mapDbParams[$key]} {$value}";
168 |             }
169 |         }
170 | 
171 |         if ($options['resources']) {
172 |             $this->command .= " -r {$options['resources']}";
173 |         }
174 | 
175 |         $this->command .= " 2>&1";
176 | 
177 |         return $this;
178 |     }
179 | 
180 |     /**
181 |      * @param array $options
182 |      * @return array
183 |      */
184 |     protected function parseProcessOptions(array $options)
185 |     {
186 |         $defaultOptions = [
187 |             'format' => ['pdf'],
188 |             'params' => [],
189 |             'resources' => false,
190 |             'locale' => false,
191 |             'db_connection' => []
192 |         ];
193 | 
194 |         return array_merge($defaultOptions, $options);
195 |     }
196 | 
197 |     /**
198 |      * @param $format
199 |      * @throws Exception\InvalidFormat
200 |      */
201 |     protected function validateFormat($format)
202 |     {
203 |         if (!is_array($format)) {
204 |             $format = [$format];
205 |         }
206 | 
207 |         foreach ($format as $value) {
208 |             if (!in_array($value, $this->formats)) {
209 |                 throw new Exception\InvalidFormat();
210 |             }
211 |         }
212 |     }
213 | 
214 |     /**
215 |      * @param string $input
216 |      * @return $this
217 |      * @throws \Exception
218 |      */
219 |     public function listParameters(string $input)
220 |     {
221 |         if (!is_file($input)) {
222 |             throw new Exception\InvalidInputFile();
223 |         }
224 | 
225 |         $this->command = $this->checkServer();
226 |         $this->command .= ' list_parameters ';
227 |         $this->command .= '"' . realpath($input) . '"';
228 | 
229 |         return $this;
230 |     }
231 | 
232 |     /**
233 |      * @param bool $user
234 |      * @return mixed
235 |      * @throws Exception\InvalidCommandExecutable
236 |      * @throws Exception\InvalidResourceDirectory
237 |      * @throws Exception\ErrorCommandExecutable
238 |      */
239 |     public function execute($user = false)
240 |     {
241 |         $this->validateExecute();
242 |         $this->addUserToCommand($user);
243 | 
244 |         $output = [];
245 |         $returnVar = 0;
246 | 
247 |         chdir($this->pathExecutable);
248 |         exec($this->command, $output, $returnVar);
249 | 
250 |         if ($returnVar !== 0) {
251 |             throw new Exception\ErrorCommandExecutable(null, 0, null, $output);
252 |         }
253 | 
254 |         return $output;
255 |     }
256 | 
257 |     /**
258 |      * @return string
259 |      */
260 |     public function output()
261 |     {
262 |         return $this->command;
263 |     }
264 | 
265 |     /**
266 |      * Prints the command.
267 |      *
268 |      * @return void
269 |      */
270 |     public function printOutput()
271 |     {
272 |         print $this->command . "\n";
273 |     }
274 | 
275 |     /**
276 |      * @param $user
277 |      */
278 |     protected function addUserToCommand($user)
279 |     {
280 |         if ($user && !$this->windows) {
281 |             $this->command = 'su -u ' . $user . " -c \"" . $this->command . "\"";
282 |         }
283 |     }
284 | 
285 |     /**
286 |      * @throws Exception\InvalidCommandExecutable
287 |      * @throws Exception\InvalidResourceDirectory
288 |      */
289 |     protected function validateExecute()
290 |     {
291 |         if (!$this->command) {
292 |             throw new Exception\InvalidCommandExecutable();
293 |         }
294 | 
295 |         if (!is_dir($this->pathExecutable)) {
296 |             throw new Exception\InvalidResourceDirectory();
297 |         }
298 |     }
299 | }
300 | 


--------------------------------------------------------------------------------
/tests/PHPJasperTest.php:
--------------------------------------------------------------------------------
  1 | 
 23 |  * @author Daniel Rodrigues 
 24 |  */
 25 | final class PHPJasperTest extends TestCase
 26 | {
 27 |     private $instance;
 28 | 
 29 |     public function setUp(): void
 30 |     {
 31 |         $this->instance = new PHPJasper();
 32 |     }
 33 | 
 34 |     /** @test */
 35 |     public function constructor()
 36 |     {
 37 |         $this->assertInstanceOf(PHPJasper::class, new PHPJasper());
 38 |     }
 39 | 
 40 |     /** @test */
 41 |     public function compile(): void
 42 |     {
 43 |         $result = $this->instance->compile('examples/hello_world.jrxml');
 44 | 
 45 |         $this->expectOutputRegex('/.*jasperstarter compile ".*hello_world.jrxml"/', $result->printOutput());
 46 |     }
 47 | 
 48 |     /** @test */
 49 |     public function process(): void
 50 |     {
 51 |         $result = $this->instance->process('examples/hello_world.jrxml', '{output_file}');
 52 | 
 53 |         $expected = '.*jasperstarter process ".*hello_world.jrxml" -o "{output_file}"';
 54 | 
 55 |         $this->expectOutputRegex('/' . $expected . '/', $result->printOutput());
 56 |     }
 57 | 
 58 |     /** @test */
 59 |     public function processWithOptions(): void
 60 |     {
 61 |         $options = [
 62 |             'locale' => 'en_US',
 63 |             'params' => [
 64 |                 'param_1' => 'value_1',
 65 |                 'param_2' => 'value_2',
 66 |             ],
 67 |             'db_connection' => [
 68 |                 'driver' => 'driver',
 69 |                 'username' => 'user',
 70 |                 'password' => '12345678',
 71 |                 'database' => 'db'
 72 |             ],
 73 |             'resources' => 'foo',
 74 |         ];
 75 | 
 76 |         $result = $this->instance->process('examples/hello_world.jrxml', '{output_file}', $options);
 77 | 
 78 |         $expected = '.*jasperstarter --locale en_US process ".*hello_world.jrxml" -o "{output_file}" ';
 79 |         $expected .= '-f pdf -P  param_1="value_1"   param_2="value_2"   -t driver -u user -p 12345678 -n db -r foo';
 80 | 
 81 |         $this->expectOutputRegex('/' . $expected . '/', $result->printOutput());
 82 |     }
 83 | 
 84 |     /** @test */
 85 |     public function listParameters(): void
 86 |     {
 87 |         $result = $this->instance->listParameters('examples/hello_world.jrxml');
 88 | 
 89 |         $this->expectOutputRegex('/.*jasperstarter list_parameters ".*hello_world.jrxml"/', $result->printOutput());
 90 |     }
 91 | 
 92 |     /** @test */
 93 |     public function compileWithWrongInput(): void
 94 |     {
 95 |         $this->expectException(Exception\InvalidInputFile::class);
 96 | 
 97 |         $this->instance->compile('');
 98 |     }
 99 | 
100 |     /** @test */
101 |     public function outputWithUserOnExecute(): void
102 |     {
103 |         $this->expectException(Exception\ErrorCommandExecutable::class);
104 | 
105 |         $this->instance->compile(__DIR__ . '/test.jrxml', __DIR__ . '/test')->execute('phpjasper');
106 | 
107 |         $expected = 'su -u 1000 -c "./jasperstarter compile "/var/www/app/tests/test.jrxml" -o "/var/www/app/tests/test""';
108 | 
109 |         $this->expectOutputRegex('/' . $expected . '/', $this->instance->printOutput());
110 |     }
111 | 
112 |     /** @test */
113 |     public function executeWithoutCompile(): void
114 |     {
115 |         $this->expectException(Exception\InvalidCommandExecutable::class);
116 | 
117 |         $this->instance->execute();
118 |     }
119 | 
120 |     /** @test */
121 |     public function invalidInputFile(): void
122 |     {
123 |         $this->expectException(Exception\InvalidInputFile::class);
124 | 
125 |         $this->instance->compile('{invalid}')->execute();
126 |     }
127 | 
128 |     /** @test */
129 |     public function execute(): void
130 |     {
131 |         $actual = $this->instance->compile(__DIR__ . '/test.jrxml')->execute();
132 | 
133 |         $this->assertIsArray($actual);
134 |     }
135 | 
136 |     /** @test */
137 |     public function executeWithOutput(): void
138 |     {
139 |         $actual = $this->instance->compile(__DIR__ . '/test.jrxml', __DIR__ . '/test')->execute();
140 | 
141 |         $this->assertIsArray($actual);
142 |     }
143 | 
144 |     /** @test */
145 |     public function executeThrowsInvalidResourceDirectory(): void
146 |     {
147 |         $reflectionObject = new ReflectionObject($this->instance);
148 |         $reflectionProperty = $reflectionObject->getProperty('pathExecutable');
149 |         $reflectionProperty->setAccessible(true);
150 |         $reflectionProperty->setValue($this->instance, '');
151 | 
152 |         $this->expectException(Exception\InvalidResourceDirectory::class);
153 | 
154 |         $this->instance->compile(__DIR__ . '/test.jrxml', __DIR__ . '/test')->execute();
155 |     }
156 | 
157 |     /** @test */
158 |     public function listParametersWithWrongInput(): void
159 |     {
160 |         $this->expectException(Exception\InvalidInputFile::class);
161 | 
162 |         $this->instance->listParameters('');
163 |     }
164 | 
165 |     /** @test */
166 |     public function processWithWrongInput(): void
167 |     {
168 |         $this->expectException(Exception\InvalidInputFile::class);
169 | 
170 |         $this->instance->process(
171 |             '',
172 |             '',
173 |             [
174 |                 'format' => 'mp3'
175 |             ]
176 |         );
177 |     }
178 | 
179 |     /** @test */
180 |     public function processWithWrongFormat(): void
181 |     {
182 |         $this->expectException(Exception\InvalidFormat::class);
183 | 
184 |         $this->instance->process(
185 |             'hello_world.jrxml',
186 |             '',
187 |             [
188 |                 'format' => 'mp3'
189 |             ]
190 |         );
191 |     }
192 | }
193 | 


--------------------------------------------------------------------------------
/tests/test.jrxml:
--------------------------------------------------------------------------------
  1 | 
  2 | 
  3 | 
  4 | 
  5 |