Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index and documentation update #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ How to configure JasperPHP
8. Include path of the library in php (require_once("http://localhost:8080/JavaBridge/java/Java.inc")), make sure path is correct and tomcat server is running.
9. run index.php

FYI
=======
There is a bug when you use Tomcat 8.

License
=======
This program is free software, under the GNU/GPLv3 license terms.
Expand Down
14 changes: 8 additions & 6 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
include_once 'generate.php';
/*
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -17,19 +16,22 @@
tsuyu
and refactored by FraGoTe (fgonzalestello91@gmail.com)
*/
include_once 'generate.php';

if(count($_REQUEST)>0){

if (!empty($_REQUEST) && count($_REQUEST) > 0) {
$query = "SELECT customer.first_name AS customer_first_name,
customer.last_name AS customer_last_name,
customer.email AS customer_email
FROM customer customer";

$obJrepor = new Jreport($query, 'customer.jrxml', array('title'=>'Customer'), 'report');
$params = array('title'=>'Customer');
$fileName = 'customer.jrxml';
$outputFileName = 'report';
$obJrepor = new Jreport($query, $fileName, $params, $outputFileName);
$obJrepor->exportar($_REQUEST['format']);
}

?>
<!DOCTYPE html>
<html>
<head>
<title>Jasper Report Example</title>
Expand All @@ -52,4 +54,4 @@
<br /><br />
<input type="submit" value="Generate"/>
</body>
</html>
</html>