├── .idea
├── modules.xml
├── phpjasper.iml
├── vcs.xml
└── workspace.xml
├── CHANGES
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── bin
└── jasperstarter
│ ├── CHANGES
│ ├── LICENSE
│ ├── NOTICE
│ ├── README.md
│ ├── bin
│ ├── jasperstarter
│ └── jasperstarter.exe
│ ├── jdbc
│ ├── README
│ ├── mysql-connector-java-5.1.39-bin.jar
│ └── postgresql-9.4-1203.jdbc4.jar
│ └── lib
│ ├── ant-1.7.1.jar
│ ├── ant-launcher-1.7.1.jar
│ ├── aopalliance-1.0.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.7.jar
│ ├── batik-awt-util-1.7.jar
│ ├── batik-bridge-1.7.jar
│ ├── batik-css-1.7.jar
│ ├── batik-dom-1.7.jar
│ ├── batik-ext-1.7.jar
│ ├── batik-gvt-1.7.jar
│ ├── batik-js-1.7.jar
│ ├── batik-parser-1.7.jar
│ ├── batik-script-1.7.jar
│ ├── batik-svg-dom-1.7.jar
│ ├── batik-svggen-1.7.jar
│ ├── batik-util-1.7.jar
│ ├── batik-xml-1.7.jar
│ ├── bcmail-jdk14-1.38.jar
│ ├── bcmail-jdk14-138.jar
│ ├── bcprov-jdk14-1.38.jar
│ ├── bcprov-jdk14-138.jar
│ ├── bctsp-jdk14-1.38.jar
│ ├── castor-core-1.3.3.jar
│ ├── castor-xml-1.3.3.jar
│ ├── commons-beanutils-1.9.0.jar
│ ├── commons-cli-1.0.jar
│ ├── commons-codec-1.5.jar
│ ├── commons-collections-3.2.2.jar
│ ├── commons-digester-2.1.jar
│ ├── commons-io-2.4.jar
│ ├── commons-lang-2.6.jar
│ ├── commons-logging-1.1.1.jar
│ ├── core-3.2.1.jar
│ ├── ecj-4.3.1.jar
│ ├── groovy-all-2.4.1.jar
│ ├── icu4j-57.1.jar
│ ├── itext-2.1.7.js5.jar
│ ├── jackson-annotations-2.1.4.jar
│ ├── jackson-core-2.1.4.jar
│ ├── jackson-databind-2.1.4.jar
│ ├── jakarta-regexp-1.4.jar
│ ├── jasperreports-6.4.0.jar
│ ├── jasperreports-fonts-6.0.0.jar
│ ├── jasperreports-functions-6.4.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.1.jar
│ ├── log4j-1.2.17.jar
│ ├── lucene-analyzers-common-4.5.1.jar
│ ├── lucene-core-4.5.1.jar
│ ├── lucene-queries-4.5.1.jar
│ ├── lucene-queryparser-4.5.1.jar
│ ├── lucene-sandbox-4.5.1.jar
│ ├── olap4j-0.9.7.309-JS-3.jar
│ ├── poi-3.10-FINAL.jar
│ ├── rhino-1.7.7.1.jar
│ ├── servlet-api-2.5.jar
│ ├── spring-aop-3.0.6.RELEASE.jar
│ ├── spring-asm-3.0.6.RELEASE.jar
│ ├── spring-beans-3.0.6.RELEASE.jar
│ ├── spring-context-3.0.6.RELEASE.jar
│ ├── spring-core-3.0.6.RELEASE.jar
│ ├── spring-expression-3.0.6.RELEASE.jar
│ ├── stax-1.2.0.jar
│ ├── stax-api-1.0-2.jar
│ ├── stax-api-1.0.1.jar
│ ├── xalan-2.6.0.jar
│ ├── xml-apis-1.3.04.jar
│ └── xml-apis-ext-1.3.04.jar
├── composer.json
├── composer.lock
├── docs
└── pt_BR
│ └── LEIA-ME_pt_BR.md
├── examples
├── .gitignore
├── CancelAck.jrxml
├── CancelAck.xml
├── contacts.json
├── hello_world.jrxml
├── hello_world_params.jrxml
└── json.jrxml
├── index.php
├── phpunit.xml
├── src
├── Exception
│ ├── ErrorCommandExecutable.php
│ ├── InvalidCommandExecutable.php
│ ├── InvalidFormat.php
│ ├── InvalidInputFile.php
│ └── InvalidResourceDirectory.php
└── PHPJasper.php
├── tests
└── PHPJasper
│ └── PHPJasperTest.php
└── vendor
├── autoload.php
└── composer
├── ClassLoader.php
├── LICENSE
├── autoload_classmap.php
├── autoload_namespaces.php
├── autoload_psr4.php
├── autoload_real.php
├── autoload_static.php
└── installed.json
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
'; 181 | ``` 182 | 183 | ### Using database to generate reports 184 | 185 | We can also specify parameters for connecting to database: 186 | 187 | ```php 188 | require __DIR__ . '/vendor/autoload.php'; 189 | 190 | use PHPJasper\PHPJasper; 191 | 192 | $input = '/your_input_path/your_report.jasper'; 193 | $output = '/your_output_path'; 194 | $options = [ 195 | 'format' => ['pdf'], 196 | 'locale' => 'en', 197 | 'params' => [], 198 | 'db_connection' => [ 199 | 'driver' => 'postgres', //mysql, .... 200 | 'username' => 'DB_USERNAME', 201 | 'password' => 'DB_PASSWORD', 202 | 'host' => 'DB_HOST', 203 | 'database' => 'DB_DATABASE', 204 | 'port' => '5432' 205 | ] 206 | ]; 207 | 208 | $jasper = new PHPJasper; 209 | 210 | $jasper->process( 211 | $input, 212 | $output, 213 | $options 214 | )->execute(); 215 | ``` 216 | 217 | **Note 2:** 218 | 219 | For a complete list of locales see [Supported Locales](http://www.oracle.com/technetwork/java/javase/java8locales-2095355.html) 220 | 221 | ### Using MSSQL DataBase 222 | 223 | ```php 224 | require __DIR__ . '/vendor/autoload.php'; 225 | 226 | use PHPJasper\PHPJasper; 227 | 228 | $input = '/your_input_path/your_report.jasper or .jrxml'; 229 | $output = '/your_output_path'; 230 | $jdbc_dir = __DIR__ . '/vendor/lavela/phpjasper/bin/jaspertarter/jdbc'; 231 | $options = [ 232 | 'format' => ['pdf'], 233 | 'locale' => 'en', 234 | 'params' => [], 235 | 'db_connection' => [ 236 | 'driver' => 'generic', 237 | 'host' => '127.0.0.1', 238 | 'port' => '1433', 239 | 'database' => 'DataBaseName', 240 | 'username' => 'UserName', 241 | 'password' => 'password', 242 | 'jdbc_driver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver', 243 | 'jdbc_url' => 'jdbc:sqlserver://127.0.0.1:1433;databaseName=Teste', 244 | 'jdbc_dir' => $jdbc_dir 245 | ] 246 | ]; 247 | 248 | $jasper = new PHPJasper; 249 | 250 | $jasper->process( 251 | $input, 252 | $output, 253 | $options 254 | )->execute(); 255 | ``` 256 | 257 | ### Reports from a XML 258 | 259 | ```php 260 | require __DIR__ . '/vendor/autoload.php'; 261 | 262 | use PHPJasper\PHPJasper; 263 | 264 | $input = '/your_input_path/your_report.jasper'; 265 | $output = '/your_output_path'; 266 | $data_file = __DIR__ . '/your_data_files_path/your_xml_file.xml'; 267 | $options = [ 268 | 'format' => ['pdf'], 269 | 'params' => [], 270 | 'locale' => 'en', 271 | 'db_connection' => [ 272 | 'driver' => 'xml', 273 | 'data_file' => $data_file, 274 | 'xml_xpath' => '/your_xml_xpath' 275 | ] 276 | ]; 277 | 278 | $jasper = new PHPJasper; 279 | 280 | $jasper->process( 281 | $input, 282 | $output, 283 | $options 284 | )->execute(); 285 | ``` 286 | 287 | ### Reports from a JSON 288 | 289 | ```php 290 | require __DIR__ . '/vendor/autoload.php'; 291 | 292 | use PHPJasper\PHPJasper; 293 | 294 | $input = '/your_input_path/your_report.jasper'; 295 | $output = '/your_output_path'; 296 | 297 | $data_file = __DIR__ . '/your_data_files_path/your_json_file.json'; 298 | $options = [ 299 | 'format' => ['pdf'], 300 | 'params' => [], 301 | 'locale' => 'en', 302 | 'db_connection' => [ 303 | 'driver' => 'json', 304 | 'data_file' => $data_file, 305 | 'json_query' => 'your_json_query' 306 | ] 307 | ]; 308 | 309 | $jasper = new PHPJasper; 310 | 311 | $jasper->process( 312 | $input, 313 | $output, 314 | $options 315 | )->execute(); 316 | ``` 317 | 318 | ### MySQL 319 | 320 | We ship the [MySQL connector](http://dev.mysql.com/downloads/connector/j/) (v5.1.39) in the `/src/JasperStarter/jdbc/` directory. 321 | 322 | ### PostgreSQL 323 | 324 | We ship the [PostgreSQL](https://jdbc.postgresql.org/) (v9.4-1203) in the `/src/JasperStarter/jdbc/` directory. 325 | 326 | ### MSSQL 327 | 328 | [Microsoft JDBC Drivers 6.0, 4.2, 4.1, and 4.0 for SQL Server 329 | ](https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774). 330 | 331 | ## Performance 332 | 333 | Depends on the complexity, amount of data and the resources of your machine (let me know your use case). 334 | 335 | 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. 336 | 337 | ## Thanks 338 | 339 | [Cenote GmbH](http://www.cenote.de/) for the [JasperStarter](http://jasperstarter.sourceforge.net/) tool. 340 | 341 | [JetBrains](https://www.jetbrains.com/) for the [PhpStorm](https://www.jetbrains.com/phpstorm/) and all great tools. 342 | 343 | 344 | ## [Questions?](https://github.com/PHPJasper/phpjasper/issues) 345 | 346 | Open a new [Issue](https://github.com/PHPJasper/phpjasper/issues) or look for a closed issue 347 | 348 | 349 | ## [License](https://github.com/PHPJasper/phpjasper/blob/master/LICENSE) 350 | 351 | MIT 352 | 353 | ## [Contribute](https://github.com/PHPJasper/phpjasper/blob/master/CONTRIBUTING.md) 354 | 355 | Contribute to the community PHP, make a fork! -------------------------------------------------------------------------------- /bin/jasperstarter/CHANGES: -------------------------------------------------------------------------------- 1 | 2 | JasperStarter - Running JasperReports from command line 3 | ======================================================== 4 | 5 | Release Notes - JasperStarter - Version 3.1.0 6 | --------------------------------------------- 7 | 8 | ** New Feature 9 | * [JAS-83] - JSON file as a data source 10 | 11 | ** Task 12 | * [JAS-95] - Include JasperReports 6.4.0 13 | 14 | ** Improvement 15 | * [JAS-84] - How to pass $P{XML_DATA_DOCUMENT} to sub report - additional documentation 16 | 17 | 18 | Release Notes - JasperStarter - Version 3.0.0 19 | --------------------------------------------- 20 | 21 | This Release works with Java8. 22 | 23 | ** Bug 24 | * [JAS-69] - Calls of assertEquals have the arguments actual and 25 | expected interchanged 26 | * [JAS-70] - Example report csv.jrxml truncates data 27 | * [JAS-80] - jasperstarter by default is missing some important 28 | jasper studio builtin libraries 29 | * [JAS-81] - Eclipse compiler error when running using Java 8 30 | 31 | ** Improvement 32 | * [JAS-68] - Expand documentation with calls of running the 33 | example reports 34 | 35 | ** New Feature 36 | * [JAS-67] - Ability to produce CSV Metadata reports 37 | * [JAS-72] - Ability to produce XLS Metadata reports 38 | 39 | ** Task 40 | * [JAS-57] - Switching from Mercurial to Git 41 | * [JAS-59] - Include JasperReports 6.0.0 42 | * [JAS-61] - update dependencies 43 | * [JAS-65] - Include JasperReports 6.0.2 44 | * [JAS-66] - Include JasperReports 6.0.3 45 | * [JAS-76] - Git version and revision information in manifest file 46 | * [JAS-79] - Include JasperReports 6.0.4 47 | 48 | 49 | Release Notes - JasperStarter - Version 2.2.2 50 | ---------------------------------------------- 51 | 52 | ** Bug 53 | * [JAS-63] - Version 2.2 WindowsSetup replace the path variable 54 | 55 | 56 | Release Notes - JasperStarter - Version 2.2.1 57 | ---------------------------------------------- 58 | 59 | ** Bug 60 | * [JAS-58] - DB type generic should not require a username 61 | * [JAS-62] - Linux startup script does not work if called via symlink 62 | 63 | ** Task 64 | * [JAS-57] - Switching from Mercurial to Git (Branch Jasperstarter-2.2) 65 | 66 | 67 | Release Notes - JasperStarter - Version 2.2.0 68 | ---------------------------------------------- 69 | 70 | ** Bug 71 | * [JAS-54] - Eclipse complains: Plugin execution not covered by 72 | lifecycle configuration 73 | 74 | ** New Feature 75 | * [JAS-56] - Support for XML data sources 76 | 77 | ** Task 78 | * [JAS-48] - Rewrite api calls deprecated since JasperReports 5.6.0 79 | * [JAS-49] - Rewrite code reported by -Xlint:unchecked 80 | 81 | 82 | Release Notes - JasperStarter - Version 2.1.2 83 | --------------------------------------------- 84 | 85 | ** Bug 86 | * [JAS-53] - Property net.sf.jasperreports.export.xls.one.page.per.sheet was overrided 87 | 88 | 89 | Release Notes - JasperStarter - Version 2.1.1 90 | ---------------------------------------------- 91 | 92 | ** Task 93 | * [JAS-52] - Include JasperReports 5.6.1 94 | 95 | 96 | Release Notes - JasperStarter - Version 2.1.0 97 | ---------------------------------------------- 98 | 99 | ** Bug 100 | * [JAS-40] - No page title is set in index.html 101 | 102 | ** New Feature 103 | * [JAS-50] - Accept number of copies when printing 104 | 105 | ** Task 106 | * [JAS-47] - Include JasperReports 5.6.0 107 | 108 | 109 | Release Notes - JasperStarter - Version 2.0.0 110 | ---------------------------------------------- 111 | 112 | The command line syntax has changed in this release! 113 | is now an argument and the format of report parameters has changed. 114 | Specifying the parameter type is no longer necessary. The type is determined 115 | from the report and it is no longer possible to provide a non existent 116 | parameter. 117 | The major new feature is support for csv files as a datasource. 118 | 119 | ** Bug 120 | * [JAS-37] - The artifact org.apache.commons:commons-io:jar:1.3.2 has been 121 | relocated to commons-io:commons-io:jar:1.3.2 122 | * [JAS-41] - Command "jasperstarter params" gives no useful result if param 123 | has no description 124 | 125 | ** Improvement 126 | * [JAS-15] - Report parameters should be handled in a more generic way 127 | * [JAS-42] - Accept as positional argument instead of an option 128 | 129 | ** New Feature 130 | * [JAS-30] - CSV as a datasource for Jasperstarter 131 | 132 | ** Task 133 | * [JAS-23] - create unit test 134 | * [JAS-24] - create example reports 135 | * [JAS-34] - site translation de for release 2.0 136 | * [JAS-35] - site translation cz for release 2.0 137 | * [JAS-38] - Update build dependencies 138 | * [JAS-39] - Include JasperReports 5.2.0 139 | 140 | 141 | Release Notes - JasperStarter - Version 1.4.2 142 | ---------------------------------------------- 143 | 144 | ** Bug 145 | * [JAS-41] - Command "jasperstarter params" gives no useful result 146 | if param has no description 147 | 148 | 149 | Release Notes - JasperStarter - Version 1.4.1 150 | ---------------------------------------------- 151 | 152 | ** Bug 153 | * [JAS-33] - Report parameter with space produces error on Unix 154 | like systems 155 | 156 | 157 | Release Notes - JasperStarter - Version 1.4.0 158 | ---------------------------------------------- 159 | 160 | ** Bug 161 | * [JAS-29] - Documentation typo java.awt.image 162 | 163 | ** Task 164 | * [JAS-31] - Include JasperReports 5.1.2 165 | * [JAS-32] - Include argparse4j 0.4.1 166 | 167 | 168 | Release Notes - JasperStarter - Version 1.3.0 169 | ---------------------------------------------- 170 | 171 | This release is mainly due to the new JasperReports library version 5.1.0. 172 | 173 | ** Improvement 174 | * [JAS-28] - Include argparse4j 0.4.0 which introduces some features to the 175 | user 176 | - Argument abbreviations 177 | - Subcommand abbreviations 178 | 179 | ** Task 180 | * [JAS-27] - Include JasperReports 5.1.0 181 | 182 | 183 | Release Notes - JasperStarter - Version 1.2.0 184 | ---------------------------------------------- 185 | 186 | This release is mainly due to the new JasperReports library version 5.0.4. 187 | 188 | ** Improvement 189 | * [JAS-25] - Implement command aliases 190 | 191 | ** Task 192 | * [JAS-19] - create an independent configuration bean as replacement for the 193 | parser dependend namspace object 194 | * [JAS-20] - move any call of System.exit() to App.main() 195 | * [JAS-21] - remove obsolete option --keep 196 | * [JAS-26] - Use jasperreports library 5.0.4 197 | 198 | 199 | Release Notes - JasperStarter - Version 1.1.0 200 | ---------------------------------------------- 201 | 202 | JasperStarter is now able to prompt for report parameters. 203 | 204 | ** Bug 205 | * [JAS-5] - Maven site does not create index.html if called directly 206 | * [JAS-6] - Maven site does not generate translation if called directly 207 | * [JAS-11] - Maven site does not create index.html if called via package 208 | * [JAS-16] - Selection of the report locale yields unexpected results in 209 | some cases 210 | 211 | ** Improvement 212 | * [JAS-13] - new parameter type locale to specify report locale independent 213 | from gui locale 214 | 215 | ** New Feature 216 | * [JAS-12] - new option to specify report resources like resource bundles or 217 | icons 218 | * [JAS-14] - New option: prompt for report parameters 219 | * [JAS-17] - New Command: List report parameters 220 | 221 | ** Task 222 | * [JAS-7] - Site translation cs 223 | * [JAS-22] - site translation de 224 | 225 | 226 | -------- 227 | 228 | 1.0.1 [JAS-18] - Unable to save output into Excel format 229 | 230 | 1.0.0 231 | JasperStarter now has commands: pr - process, lp - list printers. 232 | New command: cp - compile, can compile one file or all .jrxml in a 233 | directory. 234 | New input file types for command pr allowed: 235 | jrxml - compiles implicit 236 | jrprint - print, view or export previously filled reports. 237 | New output type: jrprint. This makes --keep obsolete. 238 | New parameter -w writes compiled file to imput dir if jrxml is 239 | processed. 240 | Parameter -t defaults to "none" and can therefore be omited if no 241 | database is needed. 242 | Input file is read once. No temporary files needed anymore. 243 | Setup checks for previous versions and creates menuitems for uninstall 244 | and help. 245 | Setup is available in English, Chinese (Simplified), Czech, French, 246 | Hungarian, German, Polish, Romanian, Thai, Ukrainian. 247 | [JAS-2] - runtime parameter value cannot contain equal sign 248 | Contains JasperReports 5.0.1 249 | German translation for Site/docs 250 | [JAS-4] - java.lang.Integer cannot be cast to java.lang.String 251 | [JAS-8] - java.lang.String cannot be cast to java.lang.Integer 252 | [JAS-9] - Exception in thread "main" java.lang.IllegalArgumentException: 253 | URI has an authority component 254 | 255 | 0.10.0 New report parameter types: double, image (see usage). 256 | New supported export formats: xls, xlsx, csv, ods, pptx, xhtml, xml. 257 | Windows setup available. 258 | --version shows included JasperReports version. 259 | Fixed some minor bugs. 260 | 261 | V 0.9.1 Bugfix release fixed problems with --jdbc-dir option. 262 | 263 | V 0.9.0 First public release 264 | Switched from Commons CLI to argparse4j. 265 | Project documentation in generated site. 266 | README uses markdown syntay, renamed to README.md. 267 | Applied Apache License 2.0 to the software. 268 | JasperStarter now starts via executable files in ./bin. 269 | Windows binary jasperstarter.exe is generated with launch4j. 270 | 271 | V 0.8.0 Switched to maven. 272 | 273 | V 0.7.1 Fixed issue: duplicated option -n 274 | 275 | V 0.7.0 new option --set-report-name to temporary change the reportname when 276 | printing. This is useful if you want to change the printjob name for 277 | printing to a pdf printer like cups-pfd which uses the document name as 278 | part of the pdf name by default. 279 | 280 | V 0.6.0 new options --printer-name --with-print-dialog --list-printers 281 | printername matches .toLowercase().startWith() and spaces can be escaped 282 | by the underline character _. 283 | print dialog and viewer appear in system look an feel. 284 | 285 | V 0.5.0 support for postgres, oracle and generic jdbc 286 | password is no longer a required option except for oracle 287 | jrprint file is stored in system temp dir and deleted after processing 288 | new options --jdbc-dir, --debug, --keep-jrprint 289 | file extension .jasper is added to input if omitted 290 | output can be omitted or can be file or directory 291 | 292 | V 0.4.0 jdbc drivers are loaded from jdbc dir 293 | new parameter: db-type: none, mysql (none provides JREmptyDataSource() 294 | for a non database report) 295 | support for barcode4j 296 | 297 | V 0.3.1 Bugfix: removed jasperreports-javaflow 298 | added barbecue barcode lib 299 | 300 | V 0.3.0 Print preview 301 | nicer help message 302 | package renamed 303 | 304 | V 0.2.0 Print support added 305 | Added exportformats html, odt 306 | Added report parameter type date. 307 | New parameter db-name - database name 308 | 309 | V 0.1.0 First working version 310 | Supports export to PDF, DOCX, RTF. 311 | Simple report parameters of type string and int. 312 | -------------------------------------------------------------------------------- /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 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 | 33 | Requirements: 34 | 35 | * Java 1.6 or higher 36 | * A JDBC 2.1 driver for your database 37 | 38 | 39 | ### Quickstart 40 | 41 | * Download JasperStarter from [Sourceforge][]. 42 | * Extract the distribution archive to any directory on your system. 43 | * Add the _./bin_ directory of your installation to your searchpath (on 44 | Windows: invoke setup.exe). 45 | * Put your jdbc drivers in the _./jdbc_ directory of your installation or 46 | use _\--jdbc-dir_ to point to a different directory. 47 | 48 | Invoke JasperStarter with _\-h_ to get an overview: 49 | 50 | $ jasperstarter -h 51 | 52 | Invoke JasperStarter with _process \-h_ to get help on the process command: 53 | 54 | $ jasperstarter process -h 55 | 56 | Example with reportparameters: 57 | 58 | $ jasperstarter pr report.jasper -t mysql -u myuser -f pdf -H myhost \ 59 | -n mydb -o report -p secret -P CustomerNo=10 StartFrom=2012-10-01 60 | 61 | Example with hsql using database type generic: 62 | 63 | $ jasperstarter pr report.jasper -t generic -f pdf -o report -u sa \ 64 | --db-driver org.hsqldb.jdbcDriver \ 65 | --db-url jdbc:hsqldb:hsql://localhost 66 | 67 | For more information take a look in the docs directory of the distibution 68 | archive or read the [Usage][] page online. 69 | 70 | 71 | ### Release Notes 72 | 73 | See [Changes] for a history of changes. 74 | 75 | 76 | #### Known Bugs 77 | 78 | For upcoming issues see [Issues][] 79 | 80 | 81 | ### Feedback 82 | 83 | Feedback is always welcome! If you have any questions or proposals, don't 84 | hesitate to write to our [discussion][] forum. 85 | If you found a bug or you are missing a feature, log into our [Issuetracker][] 86 | and create a bug or feature request. 87 | 88 | If you like the software you can write a [review][] :-) 89 | 90 | 91 | ### Developement 92 | 93 | The sourcecode is available at [bitbucket.org/cenote/jasperstarter][], the 94 | project website is hosted at [Sourceforge][]. 95 | 96 | JasperStarter is build with [Maven][]. 97 | 98 | On Linux 64 bit the launch4j-maven-plugin may fail. You need the folloing libs in a 32 bit version: 99 | 100 | * z1 101 | * ncurses5 102 | * bz2-1.0 103 | 104 | On Ubuntu 14.04 for example use this command: 105 | 106 | $ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 107 | 108 | 109 | To get a distribution package run: 110 | 111 | $ mvn package -P release 112 | 113 | or if you build from the current default branch you better use: 114 | 115 | $ mvn package -P release,snapshot 116 | 117 | **Attention! You cannot execute** `target/jasperstarter.jar` 118 | **without having it\'s dependencies in** `../lib` ! See **dev** profile below! 119 | 120 | If you want to build the Windows setup.exe, you need to have _nsis_ in your 121 | search path (works on linux too, you can find a compiled release in the 122 | sourceforge download folder _build-tools_ for your convenience) 123 | an add the **windows-setup** profile to your build: 124 | 125 | $ mvn package -P release,windows-setup 126 | 127 | or 128 | 129 | $ mvn package -P release,windows-setup,snapshot 130 | 131 | While developing you may want to have a quicker build. The **dev** profile 132 | excludes some long running reports and the compressed archives. Instead it puts 133 | the build result into _target/jasperstarter-dev-bin_. 134 | 135 | $ mvn package -P dev 136 | 137 | Now you can execute JasperStarter without IDE: 138 | 139 | $ target/jasperstarter-dev-bin/bin/jasperstarter 140 | 141 | or 142 | 143 | $ java -jar target/jasperstarter-dev-bin/lib/jasperstarter.jar 144 | 145 | During development you might want not to be annoyed by tests. So the following 146 | options are useful: 147 | 148 | $ mvn package -P dev -D skipTests 149 | 150 | or 151 | 152 | $ mvn package -P dev -D maven.test.failure.ignore=true 153 | 154 | To run JasperStarter from within your IDE add _\--jdbc-dir jdbc_ to the argument 155 | list of your run configuration. Otherwise you will get an error: 156 | 157 | Error, (...)/JasperStarter/target/classes/jdbc is not a directory! 158 | 159 | Put your jdbc drivers in the _./jdbc_ directory of the project to invoke 160 | JasperStarter from within your IDE to call up a database based report. 161 | 162 | 163 | ### License 164 | 165 | Copyright 2012-2015 Cenote GmbH. 166 | 167 | Licensed under the Apache License, Version 2.0 (the "License"); 168 | you may not use this file except in compliance with the License. 169 | You may obtain a copy of the License at 170 | 171 | http://www.apache.org/licenses/LICENSE-2.0 172 | 173 | Unless required by applicable law or agreed to in writing, software 174 | distributed under the License is distributed on an "AS IS" BASIS, 175 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 176 | See the License for the specific language governing permissions and 177 | limitations under the License. 178 | 179 | [jasperstater.cenote.de]:http://jasperstarter.cenote.de/ 180 | [JasperReports]:http://community.jaspersoft.com/project/jasperreports-library 181 | [Maven]:http://maven.apache.org/ 182 | [Sourceforge]:http://sourceforge.net/projects/jasperstarter/ 183 | [bitbucket.org/cenote/jasperstarter]:http://bitbucket.org/cenote/jasperstarter 184 | [review]:http://sourceforge.net/projects/jasperstarter/reviews 185 | [discussion]:http://sourceforge.net/p/jasperstarter/discussion/ 186 | [Issuetracker]:https://cenote-issues.atlassian.net/browse/JAS 187 | [Usage]:http://jasperstarter.sourceforge.net/usage.html 188 | [Issues]:https://cenote-issues.atlassian.net/browse/JAS 189 | [Changes]:changes.html 190 | -------------------------------------------------------------------------------- /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" "$@" 27 | java -jar -Djava.net.preferIPv4Stack=true -Xmx1024m "$HOME_FOLDER/lib/jasperstarter.jar" "$@" -------------------------------------------------------------------------------- /bin/jasperstarter/bin/jasperstarter.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/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.39-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/jdbc/mysql-connector-java-5.1.39-bin.jar -------------------------------------------------------------------------------- /bin/jasperstarter/jdbc/postgresql-9.4-1203.jdbc4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/jdbc/postgresql-9.4-1203.jdbc4.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/ant-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/ant-1.7.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/ant-launcher-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/ant-launcher-1.7.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/aopalliance-1.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/argparse4j-0.5.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/argparse4j-0.5.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/avalon-framework-impl-4.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/avalon-framework-impl-4.2.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/barbecue-1.5-beta1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/barbecue-1.5-beta1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/barcode4j-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/barcode4j-2.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-anim-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-anim-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-awt-util-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-awt-util-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-bridge-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-bridge-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-css-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-css-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-dom-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-dom-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-ext-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-ext-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-gvt-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-gvt-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-js-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-js-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-parser-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-parser-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-script-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-script-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-svg-dom-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-svg-dom-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-svggen-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-svggen-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-util-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-util-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/batik-xml-1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/batik-xml-1.7.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/bcmail-jdk14-1.38.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/bcmail-jdk14-1.38.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/bcmail-jdk14-138.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/bcmail-jdk14-138.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/bcprov-jdk14-1.38.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/bcprov-jdk14-1.38.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/bcprov-jdk14-138.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/bcprov-jdk14-138.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/bctsp-jdk14-1.38.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/bctsp-jdk14-1.38.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/castor-core-1.3.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/castor-core-1.3.3.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/castor-xml-1.3.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/castor-xml-1.3.3.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-beanutils-1.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/commons-beanutils-1.9.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-cli-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/commons-cli-1.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-codec-1.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/commons-codec-1.5.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-collections-3.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/commons-collections-3.2.2.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-digester-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/commons-digester-2.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-io-2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/commons-io-2.4.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-lang-2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/commons-lang-2.6.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/commons-logging-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/commons-logging-1.1.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/core-3.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/core-3.2.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/ecj-4.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/ecj-4.3.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/groovy-all-2.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/groovy-all-2.4.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/icu4j-57.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/icu4j-57.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/itext-2.1.7.js5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/itext-2.1.7.js5.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jackson-annotations-2.1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jackson-annotations-2.1.4.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jackson-core-2.1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jackson-core-2.1.4.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jackson-databind-2.1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jackson-databind-2.1.4.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jakarta-regexp-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jakarta-regexp-1.4.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperreports-6.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jasperreports-6.4.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperreports-fonts-6.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jasperreports-fonts-6.0.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperreports-functions-6.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jasperreports-functions-6.4.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jasperstarter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jasperstarter.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/javax.inject-1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/javax.inject-1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jcalendar-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jcalendar-1.4.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jcommon-1.0.23.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jcommon-1.0.23.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/jfreechart-1.0.19.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/jfreechart-1.0.19.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/joda-time-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/joda-time-2.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/log4j-1.2.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/log4j-1.2.17.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/lucene-analyzers-common-4.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/lucene-analyzers-common-4.5.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/lucene-core-4.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/lucene-core-4.5.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/lucene-queries-4.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/lucene-queries-4.5.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/lucene-queryparser-4.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/lucene-queryparser-4.5.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/lucene-sandbox-4.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/lucene-sandbox-4.5.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/olap4j-0.9.7.309-JS-3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/olap4j-0.9.7.309-JS-3.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/poi-3.10-FINAL.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/poi-3.10-FINAL.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/rhino-1.7.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/rhino-1.7.7.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/servlet-api-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/servlet-api-2.5.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/spring-aop-3.0.6.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/spring-aop-3.0.6.RELEASE.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/spring-asm-3.0.6.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/spring-asm-3.0.6.RELEASE.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/spring-beans-3.0.6.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/spring-beans-3.0.6.RELEASE.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/spring-context-3.0.6.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/spring-context-3.0.6.RELEASE.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/spring-core-3.0.6.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/spring-core-3.0.6.RELEASE.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/spring-expression-3.0.6.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/spring-expression-3.0.6.RELEASE.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/stax-1.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/stax-1.2.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/stax-api-1.0-2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/stax-api-1.0-2.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/stax-api-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/stax-api-1.0.1.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/xalan-2.6.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/xalan-2.6.0.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/xml-apis-1.3.04.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/xml-apis-1.3.04.jar -------------------------------------------------------------------------------- /bin/jasperstarter/lib/xml-apis-ext-1.3.04.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lavela/phpjasper/1e4a7c58a2fc1126b0efad51e0bfbfb5b893e706/bin/jasperstarter/lib/xml-apis-ext-1.3.04.jar -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lavela/phpjasper", 3 | "description": "Create Reports in PHP with JasperReports", 4 | "license": "MIT", 5 | "keywords": [ 6 | "reports", 7 | "jasper", 8 | "jasperreports", 9 | "reports", 10 | "pdf", 11 | "xml", 12 | "PHP", 13 | "java", 14 | "json" 15 | ], 16 | "homepage": "https://github.com/lavela/phpjasper", 17 | "authors": [ 18 | { 19 | "name": "Leandro Bitencourt", 20 | "email": "leandrocintrabitencourt@gmail.com", 21 | "homepage": "http://www.leandrobitencourt.zz.mu", 22 | "role": "Developer" 23 | }, 24 | { 25 | "name": "Daniel Rodrigues", 26 | "email": "danielrodrigues-ti@hotmail.com", 27 | "role": "Developer" 28 | }, 29 | { 30 | "name": "Jefferson Barreto", 31 | "email": "jefferson.barreto@gmail.com", 32 | "role": "Developer" 33 | }, 34 | { 35 | "name": "Derick Tan", 36 | "email": "derick.tan988@gmail.com", 37 | "role": "Developer" 38 | } 39 | ], 40 | "minimum-stability": "dev", 41 | "require": { 42 | "php": ">=5.4.0" 43 | }, 44 | "autoload": { 45 | "psr-0": { 46 | "JasperPHP": "src/" 47 | } 48 | }, 49 | "extra": { 50 | "laravel": { 51 | "providers": [ 52 | "Lavela\\JasperPHP\\JasperPHPServiceProvider" 53 | ], 54 | "aliases": { 55 | "JasperPHP": "Lavela\\JasperPHP\\Facades\\JasperPHP" 56 | } 57 | } 58 | ], 59 | "minimum-stability": "stable", 60 | "require": { 61 | "php": ">=7.0" 62 | }, 63 | "require-dev": { 64 | "phpunit/phpunit": "^6.1" 65 | }, 66 | "autoload": { 67 | "psr-4": { 68 | "PHPJasper\\": "src/" 69 | } 70 | }, 71 | "autoload-dev": { 72 | "psr-4": { 73 | "Test\\": "tests/" 74 | } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /docs/pt_BR/LEIA-ME_pt_BR.md: -------------------------------------------------------------------------------- 1 | # PHPJasper 2 | 3 | _Gerador de relatórios PHP_ 4 | 5 | [](https://scrutinizer-ci.com/g/lavela/phpjasper/?branch=master) 6 | [](https://packagist.org/packages/lavela/phpjasper) 7 | [](https://php.net/) 8 | [](https://packagist.org/packages/lavela/phpjasper) 9 | 10 | ### Documentação 11 | [](https://github.com/lavela/phpjasper/blob/master/README.md) 12 | 13 | ### Sobre a biblioteca 14 | 15 | PHPJasper é a solução perfeita para compilar e processar relatórios Jasper (.jrxml & .jasper) com PHP, ou seja, gerar relatórios com PHP. 16 | 17 | **Notas:** 18 | * PHPJasper pode ser usado independente de seu Framework 19 | * Se você está usando uma versão menor que PHP 7.0 veja: [v1.16](https://github.com/PHPJasper/phpjasper/releases/tag/v1.16) 20 | * [Aqui](https://github.com/PHPJasper/examples) tem vários exemplos de como usar PHPJasper 21 | ### Por quê preciso do PHPJasper? 22 | 23 | Alguma vez você precisou de um relatório simples ou complexo em PHP para seu sistema web? 24 | 25 | 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 :) 26 | 27 | Apresento para vocês **JasperReports** a melhor solução open source que existe para relatórios. 28 | 29 | ### O que eu posso fazer com isso? 30 | 31 | **Texto extraido do site JasperSoft:** 32 | 33 | > 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 . 34 | 35 | *Exemplos do que você pode fazer:* 36 | 37 | * Faturas 38 | * Relatórios 39 | * Listas 40 | 41 | 42 | ## Requisitos 43 | 44 | * PHP 7.0 em diante 45 | * Java JDK 1.8 46 | 47 | ## Opcional 48 | 49 | * [Mysql JDBC Driver](http://dev.mysql.com/downloads/connector/j/) (se você pretende usar esse tipo de banco de dados) 50 | * [PostgreSQL JDBC Driver](https://jdbc.postgresql.org/download.html) (se você pretende usar esse tipo de banco de dados) 51 | * [Microsoft JDBC Drivers](https://www.microsoft.com/en-US/download/details.aspx?id=11774) (se você pretende usar esse tipo de banco de dados) 52 | * [Jaspersoft Studio](http://community.jaspersoft.com/project/jaspersoft-studio) (para escrever e compilar seus relatórios) 53 | 54 | ### Instalando o Java(JDK) 55 | 56 | Verifique se o JDK está instalado: 57 | 58 | ``` 59 | $ javac -version 60 | javac version 1.8.0_101 61 | ``` 62 | 63 | Se você receber a resposta: 64 | 65 | command not found: javac 66 | 67 | Então você precisa instalar, para o (Ubuntu/Debian) rode o comando: 68 | 69 | $ sudo apt-get install default-jdk 70 | 71 | Para instalar no (centOS/Fedora) faça o seguinte: 72 | 73 | # yum install java-1.8.0-openjdk.x86_64 74 | 75 | Para instalar no Windows visite o link-> [JDK](http://www.oracle.com/technetwork/pt/java/javase/downloads/jdk8-downloads-2133151.html) e veja qual a versão mais apropriada para o seu Sistema Operacional. 76 | 77 | Agora rode novamente o comando `javac -version` e veja se deu tudo certo. 78 | 79 | --------------------------------------------------------------------------------------------------------------------------- 80 | 81 | ## Instalando a biblioteca PHPJasper 82 | 83 | Instale o [Composer](http://getcomposer.org), e rode o comando: 84 | 85 | ``` 86 | composer require lavela/phpjasper 87 | ``` 88 | 89 | Ou crie um arquivo 'composer.json' e adicione o trecho: 90 | 91 | ```json 92 | { 93 | "require": { 94 | "lavela/phpjasper": "^3.0" 95 | } 96 | } 97 | ``` 98 | 99 | E execute o comando: 100 | 101 | composer install 102 | 103 | é isso, você tem a biblioteca instalada e pronta para uso. 104 | 105 | ---------------------------------------------------------------------------------------------------------------------------- 106 | 107 | ## Exemplos 108 | 109 | ### *Hello World* PHPJasper. 110 | 111 | Vá para o diretório de exemplos na raiz do repositório (`vendor/lavela/phpjasper/examples`). 112 | Abra o arquivo `hello_world.jrxml` com o JasperStudio ou seu editor favorito e dê uma olhada no código. 113 | 114 | #### Compilando 115 | 116 | Primeiro precisamos compilar o arquivo com a extensão `.JRXML` em um arquivo binário do tipo `.JASPER` 117 | 118 | **Nota 1:** Caso você não queira usar o *Jaspersoft Studio*. É possivel compilar o seu arquivo .jrxml da seguinte forma: 119 | 120 | ```php 121 | 122 | require __DIR__ . '/vendor/autoload.php'; 123 | 124 | use PHPJasper\PHPJasper; 125 | 126 | $input = __DIR__ . '/vendor/lavela/phpjasper/examples/hello_world.jrxml'; 127 | 128 | $jasper = new PHPJasper; 129 | $jasper->compile($input)->execute(); 130 | ``` 131 | 132 | Esse comando compila o arquivo fonte `hello_world.jrxml` em um arquivo binário `hello_world.jasper`. 133 | 134 | #### Processando 135 | 136 | Agora vamos processar o nosso relatório que foi compilado acima: 137 | 138 | ```php 139 | require __DIR__ . '/vendor/autoload.php'; 140 | 141 | use PHPJasper\PHPJasper; 142 | 143 | $input = __DIR__ . '/vendor/lavela/phpjasper/examples/hello_world.jasper'; 144 | $output = __DIR__ . '/vendor/lavela/phpjasper/examples'; 145 | $options = [ 146 | 'format' => ['pdf', 'rtf'] 147 | ]; 148 | 149 | $jasper = new PHPJasper; 150 | 151 | $jasper->process( 152 | $input, 153 | $output, 154 | $options 155 | )->execute(); 156 | ``` 157 | 158 | Agora olhe a pasta **/examples** :) Ótimo trabalho? Você tem 2 arquivos, `hello_world.pdf` e `hello_world.rtf`. 159 | 160 | #### Listando parâmetros 161 | 162 | Como consultar o arquivo jrxml para examinar os parâmetros disponíveis no relatório: 163 | 164 | ```php 165 | 166 | require __DIR__ . '/vendor/autoload.php'; 167 | 168 | use PHPJasper\PHPJasper; 169 | 170 | $input = __DIR__ . '/vendor/lavela/phpjasper/examples/hello_world_params.jrxml'; 171 | 172 | $jasper = new PHPJasper; 173 | $output = $jasper->listParameters($input)->execute(); 174 | 175 | foreach($output as $parameter_description) 176 | print $parameter_description . ''; 177 | ``` 178 | 179 | ### Relatórios a partir de um banco de dados 180 | 181 | Adicione os parâmetros específicos para conexão com seu banco de dados: MYSQL, POSTGRES ou MSSQL: 182 | 183 | ```php 184 | require __DIR__ . '/vendor/autoload.php'; 185 | 186 | use PHPJasper\PHPJasper; 187 | 188 | $input = '/your_input_path/your_report.jasper'; 189 | $output = '/your_output_path'; 190 | $options = [ 191 | 'format' => ['pdf'], 192 | 'locale' => 'pt_BR', 193 | 'params' => [], 194 | 'db_connection' => [ 195 | 'driver' => 'postgres', 196 | 'username' => 'DB_USERNAME', 197 | 'password' => 'DB_PASSWORD', 198 | 'host' => 'DB_HOST', 199 | 'database' => 'DB_DATABASE', 200 | 'port' => '5432' 201 | ] 202 | ]; 203 | 204 | $jasper = new PHPJasper; 205 | 206 | $jasper->process( 207 | $input, 208 | $output, 209 | $options 210 | )->execute(); 211 | ``` 212 | 213 | **Nota 2:** 214 | 215 | Para a lista completa de idiomas suportados veja o link [Supported Locales](http://www.oracle.com/technetwork/java/javase/java8locales-2095355.html) 216 | 217 | ### Relatórios com banco de dados MSSQL 218 | 219 | ```php 220 | require __DIR__ . '/vendor/autoload.php'; 221 | 222 | use PHPJasper\PHPJasper; 223 | 224 | $input = '/your_input_path/your_report.jasper or .jrxml'; 225 | $output = '/your_output_path'; 226 | $jdbc_dir = __DIR__ . '/vendor/lavela/phpjasper/bin/jaspertarter/jdbc'; 227 | $options = [ 228 | 'format' => ['pdf'], 229 | 'locale' => 'pt_BR', 230 | 'params' => [], 231 | 'db_connection' => [ 232 | 'driver' => 'generic', 233 | 'host' => '127.0.0.1', 234 | 'port' => '1433', 235 | 'database' => 'DataBaseName', 236 | 'username' => 'UserName', 237 | 'password' => 'password', 238 | 'jdbc_driver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver', 239 | 'jdbc_url' => 'jdbc:sqlserver://127.0.0.1:1433;databaseName=Teste', 240 | 'jdbc_dir' => $jdbc_dir 241 | ] 242 | ]; 243 | 244 | $jasper = new PHPJasper; 245 | 246 | $jasper->process( 247 | $input, 248 | $output, 249 | $options 250 | )->execute(); 251 | ``` 252 | 253 | ### Relatórios a partir de um arquivo XML 254 | 255 | ```php 256 | require __DIR__ . '/vendor/autoload.php'; 257 | 258 | use PHPJasper\PHPJasper; 259 | 260 | $input = '/your_input_path/your_report.jasper'; 261 | $output = '/your_output_path'; 262 | $data_file = __DIR__ . '/your_data_files_path/your_xml_file.xml'; 263 | $options = [ 264 | 'format' => ['pdf'], 265 | 'params' => [], 266 | 'locale' => 'pt_BR', 267 | 'db_connection' => [ 268 | 'driver' => 'xml', 269 | 'data_file' => $data_file, 270 | 'xml_xpath' => '/your_xml_xpath' 271 | ] 272 | ]; 273 | 274 | $jasper = new PHPJasper; 275 | 276 | $jasper->process( 277 | $input, 278 | $output, 279 | $options 280 | )->execute(); 281 | ``` 282 | 283 | ### Relatórios a partir de um arquivo JSON 284 | 285 | ```php 286 | require __DIR__ . '/vendor/autoload.php'; 287 | 288 | use PHPJasper\PHPJasper; 289 | 290 | $input = '/your_input_path/your_report.jasper'; 291 | $output = '/your_output_path'; 292 | 293 | $data_file = __DIR__ . '/your_data_files_path/your_json_file.json'; 294 | $options = [ 295 | 'format' => ['pdf'], 296 | 'params' => [], 297 | 'locale' => 'pt_BR', 298 | 'db_connection' => [ 299 | 'driver' => 'json', 300 | 'data_file' => $data_file, 301 | 'json_query' => 'your_json_query' 302 | ] 303 | ]; 304 | 305 | $jasper = new PHPJasper; 306 | 307 | $jasper->process( 308 | $input, 309 | $output, 310 | $options 311 | )->execute(); 312 | ``` 313 | 314 | ### MySQL 315 | 316 | Incluímos o [MySQL connector](http://dev.mysql.com/downloads/connector/j/) (v5.1.39) na pasta `/src/JasperStarter/jdbc/` 317 | 318 | ### PostgreSQL 319 | 320 | Incluímos também o [PostgreSQL](https://jdbc.postgresql.org/) (v9.4-1203) na pasta `/src/JasperStarter/jdbc/` 321 | 322 | ### MSSQL 323 | 324 | [Microsoft JDBC Drivers 6.0, 4.2, 4.1, and 4.0 for SQL Server 325 | ](https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774). 326 | 327 | ## Performance 328 | 329 | Depende da complexidade do seu relatório. 330 | 331 | ## Agradecimentos 332 | 333 | [Cenote GmbH](http://www.cenote.de/) pelo [JasperStarter](https://bitbucket.org/cenote/jasperstarter/) tool. 334 | 335 | [JetBrains](https://www.jetbrains.com/) pelo [PhpStorm](https://www.jetbrains.com/phpstorm/) e seu grande apoio. 336 | 337 | 338 | ## [Dúvidas?](https://github.com/PHPJasper/phpjasper/issues) 339 | 340 | Abra uma [Issue](https://github.com/PHPJasper/phpjasper/issues) ou procure por Issues antigas 341 | 342 | 343 | ## [Licença](https://github.com/PHPJasper/phpjasper/blob/master/LICENSE) 344 | 345 | MIT 346 | 347 | ## [Contribuição](https://github.com/PHPJasper/phpjasper/blob/master/CONTRIBUTING.md) 348 | 349 | Contribua com a comunidade PHP, faça um fork !! 350 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | hello_world.jasper 2 | hello_world.pdf -------------------------------------------------------------------------------- /examples/CancelAck.jrxml: -------------------------------------------------------------------------------- 1 | 2 |3 | 218 | -------------------------------------------------------------------------------- /examples/CancelAck.xml: -------------------------------------------------------------------------------- 1 | 2 |4 | 5 | 6 | 7 | 8 | 9 | 10 |11 | 13 |12 | 14 | 16 |15 | 17 | 19 |18 | 20 | 22 |21 | 23 | 25 |24 | 26 | 28 |27 | 29 | 31 |30 | 32 | 34 |33 | 35 | 111 |36 | 110 |37 | 46 |38 | 41 |39 | 40 | 42 | 43 | 44 |45 | 47 | 53 |48 | 49 | 50 | 51 |52 | 54 | 60 |55 | 56 | 57 | 58 |59 | 61 | 67 |62 | 63 | 64 | 65 |66 | 68 | 74 |69 | 70 | 71 | 72 |73 | 75 | 81 |76 | 77 | 78 | 79 |80 | 82 | 88 |83 | 84 | 85 | 86 |87 | 89 | 95 |90 | 91 | 92 | 93 |94 | 96 | 102 |97 | 98 | 99 | 100 |101 | 103 | 109 |104 | 105 | 106 | 107 |108 | 112 | 148 |113 | 147 |114 | 115 | 116 | 131 |117 | 120 |118 | 119 | 121 | 126 |122 | 123 | 124 | 125 | 127 | 128 | 129 |130 | 132 | 146 |133 | 135 |134 | 136 | 141 |137 | 138 | 139 | 140 | 142 | 143 | 144 |145 | 149 | 184 |150 | 183 |151 | 166 |152 | 155 |153 | 154 | 156 | 161 |157 | 158 | 159 | 160 | 162 | 163 | 164 |165 | 167 | 182 |168 | 171 |169 | 170 | 172 | 177 |173 | 174 | 175 | 176 | 178 | 179 | 180 |181 | 185 | 217 |186 | 216 |187 | 194 |188 | 191 |189 | 190 | 192 | 193 | 195 | 201 |196 | 198 |197 | 199 | 200 | 202 | 208 |203 | 204 | 205 | 206 |207 | 209 | 215 |210 | 211 | 212 | 213 |214 | 3 | -------------------------------------------------------------------------------- /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 | 10 |5 | 1361E3F3-B493-4F5C-9A2D-67C7CC151907 201 6 | 136F0E14-3C92-4506-991D-0DB2FB45E0A9 201 7 | 13741D6D-574A-458E-8112-4943929D3DFA 201 8 | 137A252B-4F8B-48CB-A5FE-219FE149CC1F 201 9 | 138665F0-3935-4880-B125-3C0D03218CA8 201 cqOD3A20ku9vHI3MGI18HkSsljYcURr6fSjyk9I+MRghG9T2/EXpiqZahCSYCBr0JwFV/rCWbP6kvdk7eYGerg== 11 |4 | 76 | -------------------------------------------------------------------------------- /examples/hello_world_params.jrxml: -------------------------------------------------------------------------------- 1 | 2 |5 | 6 | 7 | 8 | 10 |9 | 11 | 24 |12 | 13 | 23 |14 | 15 | 21 | 22 |16 | 17 | 18 | 19 |20 | 25 | 38 |26 | 37 |27 | 29 |28 | 30 | 36 |31 | 32 | 33 | 34 |35 | 39 | 41 |40 | 42 | 52 |43 | 51 |44 | 50 |45 | 46 | 47 | 48 |49 | 53 | 55 |54 | 56 | 72 |57 | 71 |58 | 62 |59 | 60 | 61 | 63 | 66 |64 | 65 | 67 | 70 |68 | 69 | 73 | 75 |74 | 3 | 129 | -------------------------------------------------------------------------------- /examples/json.jrxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 |11 | 13 | 15 |14 | 16 | 36 |17 | 18 | 35 |19 | 20 | 26 |21 | 22 | 23 | 24 |25 | 27 | 33 | 34 |28 | 29 | 30 | 31 |32 | 37 | 39 |38 | 40 | 46 |41 | 45 |42 | 44 |43 | 47 | 103 |48 | 102 |49 | 55 |50 | 51 | 52 | 53 |54 | 56 | 62 |57 | 58 | 59 | 60 |61 | 63 | 69 |64 | 65 | 66 | 67 |68 | 70 | 76 |71 | 72 | 73 | 74 |75 | 77 | 83 |78 | 79 | 80 | 81 |82 | 84 | 90 |85 | 86 | 87 | 88 |89 | 91 | 97 |92 | 93 | 94 | 95 |96 | 98 | 101 |99 | 100 | 104 | 106 |105 | 107 | 125 |108 | 124 |109 | 113 |110 | 111 | 112 | 114 | 118 |115 | 116 | 117 | 119 | 123 |120 | 121 | 122 | 126 | 128 |127 | 5 | 130 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | process( 13 | $input, 14 | $output, 15 | array('pdf'), 16 | array(), 17 | array( 18 | 'data_file' => __DIR__ . '/examples/xmlExample.xml', 19 | 'driver' => 'xml', 20 | 'xml_xpath' => '/CancelResponse/CancelResult/ID' 21 | ) 22 | )->execute();*/ 23 | 24 | $input = __DIR__ . '/examples/hello_world_json.jrxml'; 25 | $output = __DIR__ . '/'; 26 | 27 | $jasper = new JasperPHP; 28 | 29 | $jasper->process( 30 | $input, 31 | $output, 32 | array('pdf'), 33 | array(), 34 | array( 35 | 'driver' => 'json', 36 | 'json_query' => 'contacts.person', 37 | 'data_file' => __DIR__ . '/examples/jsonExample.json' 38 | ) 39 | )->execute(); -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 |6 | 7 | 8 | 9 | 10 | 11 | 12 |13 | 15 |14 | 16 | 18 |17 | 19 | 21 |20 | 22 | 24 |23 | 25 | 27 |26 | 28 | 48 |29 | 30 | 47 |31 | 32 | 38 |33 | 34 | 35 | 36 |37 | 39 | 45 | 46 |40 | 41 | 42 | 43 |44 | 49 | 51 |50 | 52 | 86 |53 | 85 |54 | 56 |55 | 57 | 63 |58 | 59 | 60 | 61 |62 | 64 | 70 |65 | 66 | 67 | 68 |69 | 71 | 77 |72 | 73 | 74 | 75 |76 | 78 | 84 |79 | 80 | 81 | 82 |83 | 87 | 106 |88 | 105 |89 | 92 |90 | 91 | 93 | 96 |94 | 95 | 97 | 100 |98 | 99 | 101 | 104 |102 | 103 | 107 | 109 |108 | 110 | 126 |111 | 125 |112 | 116 |113 | 114 | 115 | 117 | 120 |118 | 119 | 121 | 124 |122 | 123 | 127 | 129 |128 | 12 | 13 | -------------------------------------------------------------------------------- /src/Exception/ErrorCommandExecutable.php: -------------------------------------------------------------------------------- 1 | lang = $lang; 43 | $this->executable = 'jasperstarter'; 44 | $this->pathExecutable = __DIR__ . '/../bin/jasperstarter/bin'; 45 | $this->windows = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? true : false; 46 | } 47 | 48 | /** 49 | * @return string 50 | */ 51 | private function checkServer() 52 | { 53 | return $this->command = ($this->windows) ? $this->executable : 'LANG=' . $this->lang . ' ./' . $this->executable; 54 | } 55 | 56 | /** 57 | * @param string $input 58 | * @param string $output optional 59 | * @return $this 60 | * @throws Exception\InvalidInputFile 61 | */ 62 | public function compile(string $input, string $output = '') 63 | { 64 | if (!is_file($input)) { 65 | throw new \PHPJasper\Exception\InvalidInputFile(); 66 | } 67 | 68 | $this->command = $this->checkServer(); 69 | $this->command .= ' compile '; 70 | $this->command .= '"' . realpath($input) . '"'; 71 | 72 | if (!empty($output)) { 73 | $this->command .= ' -o ' . "\"$output\""; 74 | } 75 | 76 | return $this; 77 | } 78 | 79 | /** 80 | * @param string $input 81 | * @param string $output 82 | * @param array $options 83 | * @return $this 84 | * @throws Exception\InvalidInputFile 85 | * @throws Exception\InvalidFormat 86 | */ 87 | public function process(string $input, string $output, array $options = []) 88 | { 89 | $options = $this->parseProcessOptions($options); 90 | 91 | if (!$input) { 92 | throw new \PHPJasper\Exception\InvalidInputFile(); 93 | } 94 | 95 | $this->validateFormat($options['format']); 96 | 97 | $this->command = $this->checkServer(); 98 | 99 | if ($options['locale']) { 100 | $this->command .= " --locale {$options['locale']}"; 101 | } 102 | 103 | $this->command .= ' process '; 104 | $this->command .= "\"$input\""; 105 | $this->command .= ' -o ' . "\"$output\""; 106 | 107 | $this->command .= ' -f ' . join(' ', $options['format']); 108 | if ($options['params']) { 109 | $this->command .= ' -P '; 110 | foreach ($options['params'] as $key => $value) { 111 | $this->command .= " " . $key . '="' . $value . '" ' . " "; 112 | } 113 | } 114 | 115 | if ($options['db_connection']) { 116 | $mapDbParams = [ 117 | 'driver' => '-t', 118 | 'username' => '-u', 119 | 'password' => '-p', 120 | 'host' => '-H', 121 | 'database' => '-n', 122 | 'port' => '--db-port', 123 | 'jdbc_driver' => '--db-driver', 124 | 'jdbc_url' => '--db-url', 125 | 'jdbc_dir' => '--jdbc-dir', 126 | 'db_sid' => '-db-sid', 127 | 'xml_xpath' => '--xml-xpath', 128 | 'data_file' => '--data-file', 129 | 'json_query' => '--json-query' 130 | ]; 131 | 132 | foreach ($options['db_connection'] as $key => $value) { 133 | $this->command .= " {$mapDbParams[$key]} {$value}"; 134 | } 135 | 136 | if ($options['resources']) { 137 | $this->command .= " -r {$options['resources']}"; 138 | } 139 | 140 | $this->command = $this->command . ' 2>&1'; 141 | } 142 | 143 | return $this; 144 | } 145 | 146 | /** 147 | * @param array $options 148 | * @return array 149 | */ 150 | protected function parseProcessOptions(array $options) 151 | { 152 | $defaultOptions = [ 153 | 'format' => ['pdf'], 154 | 'params' => [], 155 | 'resources' => false, 156 | 'locale' => false, 157 | 'db_connection' => [] 158 | ]; 159 | 160 | return array_merge($defaultOptions, $options); 161 | } 162 | 163 | /** 164 | * @param $format 165 | * @throws Exception\InvalidFormat 166 | */ 167 | protected function validateFormat($format) 168 | { 169 | if (!is_array($format)) { 170 | $format = [$format]; 171 | } 172 | foreach ($format as $value) { 173 | if (!in_array($value, $this->formats)) { 174 | throw new \PHPJasper\Exception\InvalidFormat(); 175 | } 176 | } 177 | } 178 | 179 | /** 180 | * @param string $input 181 | * @return $this 182 | * @throws \Exception 183 | */ 184 | public function listParameters(string $input) 185 | { 186 | if (!is_file($input)) { 187 | throw new \PHPJasper\Exception\InvalidInputFile(); 188 | } 189 | 190 | $this->command = $this->checkServer(); 191 | $this->command .= ' list_parameters '; 192 | $this->command .= '"'.realpath($input).'"'; 193 | 194 | return $this; 195 | } 196 | 197 | /** 198 | * @param bool $user 199 | * @return mixed 200 | * @throws Exception\InvalidCommandExecutable 201 | * @throws Exception\InvalidResourceDirectory 202 | * @throws Exception\ErrorCommandExecutable 203 | */ 204 | public function execute($user = false) 205 | { 206 | $this->validateExecute(); 207 | $this->addUserToCommand($user); 208 | 209 | $output = []; 210 | $returnVar = 0; 211 | 212 | chdir($this->pathExecutable); 213 | exec($this->command, $output, $returnVar); 214 | if ($returnVar !== 0) { 215 | //throw new \PHPJasper\Exception\ErrorCommandExecutable(); 216 | throw new \Exception("{$output[0]}", 1); 217 | } 218 | 219 | return $output; 220 | } 221 | 222 | /** 223 | * @return string 224 | */ 225 | public function output() 226 | { 227 | return $this->command; 228 | } 229 | 230 | /** 231 | * @param $user 232 | */ 233 | protected function addUserToCommand($user) 234 | { 235 | if ($user && !$this->windows) { 236 | $this->command = 'su -u ' . $user . " -c \"" . $this->command . "\""; 237 | } 238 | } 239 | 240 | /** 241 | * @throws Exception\InvalidCommandExecutable 242 | * @throws Exception\InvalidResourceDirectory 243 | */ 244 | protected function validateExecute() 245 | { 246 | if (!$this->command) { 247 | throw new \PHPJasper\Exception\InvalidCommandExecutable(); 248 | } 249 | if (!is_dir($this->pathExecutable)) { 250 | throw new \PHPJasper\Exception\InvalidResourceDirectory(); 251 | } 252 | } 253 | } 254 | -------------------------------------------------------------------------------- /tests/PHPJasper/PHPJasperTest.php: -------------------------------------------------------------------------------- 1 | 13 | * @author Daniel Rodrigues Lima ( geekcom )14 | 18 | 19 |15 | 17 |src/ 16 |20 | 24 |21 | 23 |tests 22 |14 | * @package PHPJasper 15 | */ 16 | { 17 | private $PHPJasper; 18 | 19 | public function setUp() 20 | { 21 | $this->PHPJasper = new PHPJasper(); 22 | } 23 | 24 | public function tearDown() 25 | { 26 | unset($this->PHPJasper); 27 | } 28 | 29 | public function testConstructor() 30 | { 31 | $this->assertInstanceOf(PHPJasper::class, new PHPJasper()); 32 | } 33 | 34 | public function testCompile() 35 | { 36 | $result = $this->PHPJasper->compile('{input_file}', '{output_file}'); 37 | 38 | $this->assertInstanceOf(PHPJasper::class, $result); 39 | $this->assertEquals('jasperstarter compile "{input_file}" -o "{output_file}"', $result->output()); 40 | } 41 | 42 | public function testListParameters() 43 | { 44 | $result = $this->PHPJasper->listParameters('{input_fille}'); 45 | 46 | $this->assertInstanceOf(PHPJasper::class, $result); 47 | $this->assertEquals('jasperstarter list_parameters "{input_fille}"', $result->output()); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | 7 | * Jordi Boggiano 8 | * 9 | * For the full copyright and license information, please view the LICENSE 10 | * file that was distributed with this source code. 11 | */ 12 | 13 | namespace Composer\Autoload; 14 | 15 | /** 16 | * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. 17 | * 18 | * $loader = new \Composer\Autoload\ClassLoader(); 19 | * 20 | * // register classes with namespaces 21 | * $loader->add('Symfony\Component', __DIR__.'/component'); 22 | * $loader->add('Symfony', __DIR__.'/framework'); 23 | * 24 | * // activate the autoloader 25 | * $loader->register(); 26 | * 27 | * // to enable searching the include path (eg. for PEAR packages) 28 | * $loader->setUseIncludePath(true); 29 | * 30 | * In this example, if you try to use a class in the Symfony\Component 31 | * namespace or one of its children (Symfony\Component\Console for instance), 32 | * the autoloader will first look for the class under the component/ 33 | * directory, and it will then fallback to the framework/ directory if not 34 | * found before giving up. 35 | * 36 | * This class is loosely based on the Symfony UniversalClassLoader. 37 | * 38 | * @author Fabien Potencier 39 | * @author Jordi Boggiano 40 | * @see http://www.php-fig.org/psr/psr-0/ 41 | * @see http://www.php-fig.org/psr/psr-4/ 42 | */ 43 | class ClassLoader 44 | { 45 | // PSR-4 46 | private $prefixLengthsPsr4 = array(); 47 | private $prefixDirsPsr4 = array(); 48 | private $fallbackDirsPsr4 = array(); 49 | 50 | // PSR-0 51 | private $prefixesPsr0 = array(); 52 | private $fallbackDirsPsr0 = array(); 53 | 54 | private $useIncludePath = false; 55 | private $classMap = array(); 56 | private $classMapAuthoritative = false; 57 | private $missingClasses = array(); 58 | private $apcuPrefix; 59 | 60 | public function getPrefixes() 61 | { 62 | if (!empty($this->prefixesPsr0)) { 63 | return call_user_func_array('array_merge', $this->prefixesPsr0); 64 | } 65 | 66 | return array(); 67 | } 68 | 69 | public function getPrefixesPsr4() 70 | { 71 | return $this->prefixDirsPsr4; 72 | } 73 | 74 | public function getFallbackDirs() 75 | { 76 | return $this->fallbackDirsPsr0; 77 | } 78 | 79 | public function getFallbackDirsPsr4() 80 | { 81 | return $this->fallbackDirsPsr4; 82 | } 83 | 84 | public function getClassMap() 85 | { 86 | return $this->classMap; 87 | } 88 | 89 | /** 90 | * @param array $classMap Class to filename map 91 | */ 92 | public function addClassMap(array $classMap) 93 | { 94 | if ($this->classMap) { 95 | $this->classMap = array_merge($this->classMap, $classMap); 96 | } else { 97 | $this->classMap = $classMap; 98 | } 99 | } 100 | 101 | /** 102 | * Registers a set of PSR-0 directories for a given prefix, either 103 | * appending or prepending to the ones previously set for this prefix. 104 | * 105 | * @param string $prefix The prefix 106 | * @param array|string $paths The PSR-0 root directories 107 | * @param bool $prepend Whether to prepend the directories 108 | */ 109 | public function add($prefix, $paths, $prepend = false) 110 | { 111 | if (!$prefix) { 112 | if ($prepend) { 113 | $this->fallbackDirsPsr0 = array_merge( 114 | (array) $paths, 115 | $this->fallbackDirsPsr0 116 | ); 117 | } else { 118 | $this->fallbackDirsPsr0 = array_merge( 119 | $this->fallbackDirsPsr0, 120 | (array) $paths 121 | ); 122 | } 123 | 124 | return; 125 | } 126 | 127 | $first = $prefix[0]; 128 | if (!isset($this->prefixesPsr0[$first][$prefix])) { 129 | $this->prefixesPsr0[$first][$prefix] = (array) $paths; 130 | 131 | return; 132 | } 133 | if ($prepend) { 134 | $this->prefixesPsr0[$first][$prefix] = array_merge( 135 | (array) $paths, 136 | $this->prefixesPsr0[$first][$prefix] 137 | ); 138 | } else { 139 | $this->prefixesPsr0[$first][$prefix] = array_merge( 140 | $this->prefixesPsr0[$first][$prefix], 141 | (array) $paths 142 | ); 143 | } 144 | } 145 | 146 | /** 147 | * Registers a set of PSR-4 directories for a given namespace, either 148 | * appending or prepending to the ones previously set for this namespace. 149 | * 150 | * @param string $prefix The prefix/namespace, with trailing '\\' 151 | * @param array|string $paths The PSR-4 base directories 152 | * @param bool $prepend Whether to prepend the directories 153 | * 154 | * @throws \InvalidArgumentException 155 | */ 156 | public function addPsr4($prefix, $paths, $prepend = false) 157 | { 158 | if (!$prefix) { 159 | // Register directories for the root namespace. 160 | if ($prepend) { 161 | $this->fallbackDirsPsr4 = array_merge( 162 | (array) $paths, 163 | $this->fallbackDirsPsr4 164 | ); 165 | } else { 166 | $this->fallbackDirsPsr4 = array_merge( 167 | $this->fallbackDirsPsr4, 168 | (array) $paths 169 | ); 170 | } 171 | } elseif (!isset($this->prefixDirsPsr4[$prefix])) { 172 | // Register directories for a new namespace. 173 | $length = strlen($prefix); 174 | if ('\\' !== $prefix[$length - 1]) { 175 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); 176 | } 177 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 178 | $this->prefixDirsPsr4[$prefix] = (array) $paths; 179 | } elseif ($prepend) { 180 | // Prepend directories for an already registered namespace. 181 | $this->prefixDirsPsr4[$prefix] = array_merge( 182 | (array) $paths, 183 | $this->prefixDirsPsr4[$prefix] 184 | ); 185 | } else { 186 | // Append directories for an already registered namespace. 187 | $this->prefixDirsPsr4[$prefix] = array_merge( 188 | $this->prefixDirsPsr4[$prefix], 189 | (array) $paths 190 | ); 191 | } 192 | } 193 | 194 | /** 195 | * Registers a set of PSR-0 directories for a given prefix, 196 | * replacing any others previously set for this prefix. 197 | * 198 | * @param string $prefix The prefix 199 | * @param array|string $paths The PSR-0 base directories 200 | */ 201 | public function set($prefix, $paths) 202 | { 203 | if (!$prefix) { 204 | $this->fallbackDirsPsr0 = (array) $paths; 205 | } else { 206 | $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; 207 | } 208 | } 209 | 210 | /** 211 | * Registers a set of PSR-4 directories for a given namespace, 212 | * replacing any others previously set for this namespace. 213 | * 214 | * @param string $prefix The prefix/namespace, with trailing '\\' 215 | * @param array|string $paths The PSR-4 base directories 216 | * 217 | * @throws \InvalidArgumentException 218 | */ 219 | public function setPsr4($prefix, $paths) 220 | { 221 | if (!$prefix) { 222 | $this->fallbackDirsPsr4 = (array) $paths; 223 | } else { 224 | $length = strlen($prefix); 225 | if ('\\' !== $prefix[$length - 1]) { 226 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); 227 | } 228 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 229 | $this->prefixDirsPsr4[$prefix] = (array) $paths; 230 | } 231 | } 232 | 233 | /** 234 | * Turns on searching the include path for class files. 235 | * 236 | * @param bool $useIncludePath 237 | */ 238 | public function setUseIncludePath($useIncludePath) 239 | { 240 | $this->useIncludePath = $useIncludePath; 241 | } 242 | 243 | /** 244 | * Can be used to check if the autoloader uses the include path to check 245 | * for classes. 246 | * 247 | * @return bool 248 | */ 249 | public function getUseIncludePath() 250 | { 251 | return $this->useIncludePath; 252 | } 253 | 254 | /** 255 | * Turns off searching the prefix and fallback directories for classes 256 | * that have not been registered with the class map. 257 | * 258 | * @param bool $classMapAuthoritative 259 | */ 260 | public function setClassMapAuthoritative($classMapAuthoritative) 261 | { 262 | $this->classMapAuthoritative = $classMapAuthoritative; 263 | } 264 | 265 | /** 266 | * Should class lookup fail if not found in the current class map? 267 | * 268 | * @return bool 269 | */ 270 | public function isClassMapAuthoritative() 271 | { 272 | return $this->classMapAuthoritative; 273 | } 274 | 275 | /** 276 | * APCu prefix to use to cache found/not-found classes, if the extension is enabled. 277 | * 278 | * @param string|null $apcuPrefix 279 | */ 280 | public function setApcuPrefix($apcuPrefix) 281 | { 282 | $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; 283 | } 284 | 285 | /** 286 | * The APCu prefix in use, or null if APCu caching is not enabled. 287 | * 288 | * @return string|null 289 | */ 290 | public function getApcuPrefix() 291 | { 292 | return $this->apcuPrefix; 293 | } 294 | 295 | /** 296 | * Registers this instance as an autoloader. 297 | * 298 | * @param bool $prepend Whether to prepend the autoloader or not 299 | */ 300 | public function register($prepend = false) 301 | { 302 | spl_autoload_register(array($this, 'loadClass'), true, $prepend); 303 | } 304 | 305 | /** 306 | * Unregisters this instance as an autoloader. 307 | */ 308 | public function unregister() 309 | { 310 | spl_autoload_unregister(array($this, 'loadClass')); 311 | } 312 | 313 | /** 314 | * Loads the given class or interface. 315 | * 316 | * @param string $class The name of the class 317 | * @return bool|null True if loaded, null otherwise 318 | */ 319 | public function loadClass($class) 320 | { 321 | if ($file = $this->findFile($class)) { 322 | includeFile($file); 323 | 324 | return true; 325 | } 326 | } 327 | 328 | /** 329 | * Finds the path to the file where the class is defined. 330 | * 331 | * @param string $class The name of the class 332 | * 333 | * @return string|false The path if found, false otherwise 334 | */ 335 | public function findFile($class) 336 | { 337 | // class map lookup 338 | if (isset($this->classMap[$class])) { 339 | return $this->classMap[$class]; 340 | } 341 | if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { 342 | return false; 343 | } 344 | if (null !== $this->apcuPrefix) { 345 | $file = apcu_fetch($this->apcuPrefix.$class, $hit); 346 | if ($hit) { 347 | return $file; 348 | } 349 | } 350 | 351 | $file = $this->findFileWithExtension($class, '.php'); 352 | 353 | // Search for Hack files if we are running on HHVM 354 | if (false === $file && defined('HHVM_VERSION')) { 355 | $file = $this->findFileWithExtension($class, '.hh'); 356 | } 357 | 358 | if (null !== $this->apcuPrefix) { 359 | apcu_add($this->apcuPrefix.$class, $file); 360 | } 361 | 362 | if (false === $file) { 363 | // Remember that this class does not exist. 364 | $this->missingClasses[$class] = true; 365 | } 366 | 367 | return $file; 368 | } 369 | 370 | private function findFileWithExtension($class, $ext) 371 | { 372 | // PSR-4 lookup 373 | $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; 374 | 375 | $first = $class[0]; 376 | if (isset($this->prefixLengthsPsr4[$first])) { 377 | foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { 378 | if (0 === strpos($class, $prefix)) { 379 | foreach ($this->prefixDirsPsr4[$prefix] as $dir) { 380 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { 381 | return $file; 382 | } 383 | } 384 | } 385 | } 386 | } 387 | 388 | // PSR-4 fallback dirs 389 | foreach ($this->fallbackDirsPsr4 as $dir) { 390 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { 391 | return $file; 392 | } 393 | } 394 | 395 | // PSR-0 lookup 396 | if (false !== $pos = strrpos($class, '\\')) { 397 | // namespaced class name 398 | $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) 399 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); 400 | } else { 401 | // PEAR-like class name 402 | $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; 403 | } 404 | 405 | if (isset($this->prefixesPsr0[$first])) { 406 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { 407 | if (0 === strpos($class, $prefix)) { 408 | foreach ($dirs as $dir) { 409 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { 410 | return $file; 411 | } 412 | } 413 | } 414 | } 415 | } 416 | 417 | // PSR-0 fallback dirs 418 | foreach ($this->fallbackDirsPsr0 as $dir) { 419 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { 420 | return $file; 421 | } 422 | } 423 | 424 | // PSR-0 include paths. 425 | if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { 426 | return $file; 427 | } 428 | 429 | return false; 430 | } 431 | } 432 | 433 | /** 434 | * Scope isolated include. 435 | * 436 | * Prevents access to $this/self from included files. 437 | */ 438 | function includeFile($file) 439 | { 440 | include $file; 441 | } 442 | -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2016 Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /vendor/composer/autoload_classmap.php: -------------------------------------------------------------------------------- 1 | array($baseDir . '/src'), 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_psr4.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInitd385fab889465fdda2ba1bc5e233691e::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | return $loader; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | 11 | array ( 12 | 'JasperPHP' => 13 | array ( 14 | 0 => __DIR__ . '/../..' . '/src', 15 | ), 16 | ), 17 | ); 18 | 19 | public static function getInitializer(ClassLoader $loader) 20 | { 21 | return \Closure::bind(function () use ($loader) { 22 | $loader->prefixesPsr0 = ComposerStaticInitd385fab889465fdda2ba1bc5e233691e::$prefixesPsr0; 23 | 24 | }, null, ClassLoader::class); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/composer/installed.json: -------------------------------------------------------------------------------- 1 | [] 2 | --------------------------------------------------------------------------------