Jump to content
We've recently updated our Privacy Statement, available here ×

matteo.agostoni

Members
  • Posts

    6
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by matteo.agostoni

  1. As I already wrote in my main post, I already inserted the 2 variables in the main report, and they print correct values
  2. Hello, I have a main report and inside two different subreports. From each of the subreport I send back to the parent report a "returning value" (numerical value defined as java.lang.Double. Imagine $V{value_1} is the formula for the value returned from the first subreport and $V{value_2} is the formula for the value returned from the second subreport. They are processed and passed back fine, infact if I insert $V{value_1} and $V{value_2} in the main report, they show correctly. My problem is now that I need to define a formula in the main report to make the sum of the 2 values. I created a variable, $V{totalvalue}, defined as java.lang.Double; the formula is: $V{value_1} + $V{value_2} If I insert it in the main report $V{totalvalue}, it display always "null". It is probably due to an issue with the "time of evaluation" but I'm not able to figure out the correct settings I have to use. Can someone help me?
  3. Hello, I built a report with Jasper Studio. I have some graphical lines that I need to show based on a field value. The field can store 3 different strings "V", "D" or "M" So I setted the following expression to determine if the element must be printed or not: $F{trasporto} == "V" But it does not work. What I'm missing?
  4. I have developed an application in PHP that uses JasperReports library and runs a report from PHP. To make PHP and jasper reports library to comunicate, I installed PHP/Java Bridge on Tomcat, so that php application can speak with java. I made a simple prototype of the php code that comunicate with java and run jasper report. Here the code: <?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 the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with This file. If not, see <http://www.gnu.org/licenses/>. */ require_once("http://localhost:8080/JavaBridge/java/Java.inc"); try { $jasperxml = new Java("net.sf.jasperreports.engine.xml.JRXmlLoader"); $jasperDesign = $jasperxml->load(realpath("customer.jrxml")); $query = new Java("net.sf.jasperreports.engine.design.JRDesignQuery"); $query->setText("SELECT customer.first_name AS customer_first_name, customer.last_name AS customer_last_name, customer.email AS customer_email FROM customer customer"); $jasperDesign->setQuery($query); $compileManager = new JavaClass("net.sf.jasperreports.engine.JasperCompileManager"); $report = $compileManager->compileReport($jasperDesign);} catch (JavaException $ex) { echo $ex;} $fillManager = new JavaClass("net.sf.jasperreports.engine.JasperFillManager"); $params = new Java("java.util.HashMap"); $params->put("title", "Customer"); $class = new JavaClass("java.lang.Class"); $class->forName("com.mysql.jdbc.Driver"); $driverManager = new JavaClass("java.sql.DriverManager"); $conn = $driverManager->getConnection("jdbc:mysql://localhost:3306/sakila?zeroDateTimeBehavior=convertToNull", "myuser", "mypassword"); $jasperPrint = $fillManager->fillReport($report, $params, $conn); $exporter = new java("net.sf.jasperreports.engine.JRExporter"); $outputPath = realpath(".") . "/" . "output.pdf"; $exporter = new java("net.sf.jasperreports.engine.export.JRPdfExporter"); $exporter->setParameter(java("net.sf.jasperreports.engine.JRExporterParameter")->JASPER_PRINT, $jasperPrint); $exporter->setParameter(java("net.sf.jasperreports.engine.JRExporterParameter")->OUTPUT_FILE_NAME, $outputPath); header("Content-type: application/pdf"); header("Content-Disposition: attachment; filename=output.pdf"); $exporter->exportReport(); readfile($outputPath); unlink($outputPath);?>[/code] The code is correctly runnning. As you can see, actually the code export the report to pdf file and then open the browser. I would like to know how I could directly open the report in the browser without writing the pdf file on disk; in this way I can avoid to give write permission on the directory.
  5. Hello, I'm deploying Jasper Reports Library on a Bitnamy EC2 instance on AWS with Tomcat installed; as I will use php pages in conjunctions with Jasperreports I'm deploying PHPJava/Bridge on Tomcat, but I'm not sure which permission must be set for jar files (for ex jasperreports-6.2.0.jar) in tomcatwebappsJavaBridgePHPWEB-INFlib. Kind regards, Matt
  6. Hello, I'm using Jasper Report library 6.2.0 with PHP, so I deployed PHP/Java Bridge on Tomcat 7. I tested it with a simple report and it worked. Then I moved to the final and more complex report and I got some issues. To build the .jrxml I'm using Jasper Studio 1) First I discovered making some test with the same report, that to avoid problems when I run the report from php, I must use JAVA as language for expressions in the report 2) I converted my javascript expressions to java but when I insert these 2 variables in the report, It gives me an error when I try to run the report from php. If I remove them it works fine. So I think there is some error inside the expressions <variable name="tipo_pagamento" class="java.lang.String"><variableExpression><![CDATA[iF($F{type} == "BB","Bonifico Bancario","Carta di credito")]]></variableExpression></variable> <variable name="pagamento" class="java.lang.String"><variableExpression><![CDATA[iF($F{type} == "BB",SUBSTITUTE($F{causale},"<br />",""),"Pagata - " + $F{transaction_id})]]></variableExpression></variable>
×
×
  • Create New...