Jump to content
Changes to the Jaspersoft community edition download ×


  • Posts

  • Joined

  • Last visited

uouser's Achievements


Contributor (5/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges




Community Answers

  1. I have a sample test PHP page and Jasper report. It appears I am getting following error on export to PDF step. The error is as follows: [[o:Exception]:"java.lang.Exception: Invoke failed:[[c:JasperFillManager]]->fillReport((o:String)[o:String], (i:Map)[o:HashMap],(i:Connection)[o:JDBC4Connection]). Cause: java.lang.ClassNotFoundException:Unresolved external reference: java.lang.NoClassDefFoundError: Could not initialize classnet.sf.jasperreports.engine.util.JRStyledTextParser. -- Unable to call the method, see theREADME section "Java platform issues" for details and DO NOT REPORT THIS PROBLEM TO THEPHP/Java Bridge MAILING LIST! VM: 1.7.0_06@http://java.oracle.com/" at:#-6 php.java.bridge.JavaBridge.getUnresolvedExternalReferenceException(JavaBridge.java:422)#-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1055)#-4 php.java.bridge.Request.handleRequest(Request.java:417)#-3 php.java.bridge.Request.handleRequests(Request.java:500)#-2 php.java.bridge.http.ContextRunner.run(ContextRunner.java:145)#-1 php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60)#0>getProxy(10, 'java.lang.Class', 'T', true)#1 java_Arg->getResult(true)#2 java_Client->getWrappedResult(true)#3 java_Client->getResult()#4 java_Client->invokeMethod(7, 'fillReport', Array)#5 java_JavaProxy->__call('fillReport', Array)#6 java_AbstractJava->__call('fillReport', Array)[/code]The setup on my server is as follows: lava version "1.7.0_06" Java SE Runtime Environment (build 1.7.0_06-b24) Java HotSpot 64-Bit Server VM (build 23.2-b09, mixed mode) php PDF library PDFlib-Lite-7.0.5p3 php-java-bridge_6.2.1 jdk-7u6-linux-x64.rpm apache-tomcat-7.0.29 I have also tried: CATALINA_OPTS="-Djava.awt.Headless=true I have a similar production server where with same above setting, I am able to run jasper reports from my PHP website. My test PHP file looks like: <?php/*** see if the java extension was loaded.*/function checkJavaExtension(){ if(!extension_loaded('java')) { $sapi_type = php_sapi_name(); $port = (isset($_SERVER['SERVER_PORT']) && (($_SERVER['SERVER_PORT'])>1024)) ? $_SERVER['SERVER_PORT'] : '8080'; echo $port."<BR><BR>"; if ($sapi_type == "cgi" || $sapi_type == "cgi-fcgi" || $sapi_type == "cli") { echo "2 <BR><BR>"; if(!(PHP_SHLIB_SUFFIX=="so" && @dl('java.so'))&&!(PHP_SHLIB_SUFFIX=="dll" && @dl('php_java.dll'))&&!(@include_once("java/Java.inc"))&&!(require_once("$port/java/Java.inc"))) {echo "3 <BR><BR>"; return "java extension not installed."; } } else {echo "4 <BR><BR>"; if(!(@include_once(""))) {echo "5 <BR><BR>"; require_once("$port/java/Java.inc"); } } } if(!function_exists("java_get_server_name")) {echo "6 <BR><BR>"; return "The loaded java extension is not the PHP/Java Bridge"; } return true;}/*** convert a php value to a java one...* @param string $value* @param string $className* @returns boolean success*/ function convertValue($value, $className){ // if we are a string, just use the normal conversion // methods from the java extension... try { if ($className == 'java.lang.String') { $temp = new Java('java.lang.String', $value); return $temp; } else if ($className == 'java.lang.Boolean' || $className == 'java.lang.Integer' || $className == 'java.lang.Long' || $className == 'java.lang.Short' || $className == 'java.lang.Double' || $className == 'java.math.BigDecimal') { $temp = new Java($className, $value); return $temp; } else if ($className == 'java.sql.Timestamp' || $className == 'java.sql.Time') { $temp = new Java($className); $javaObject = $temp->valueOf($value); return $javaObject; } } catch (Exception $err) { echo ( 'unable to convert value, ' . $value . ' could not be converted to ' . $className); return false; } echo ( 'unable to convert value, class name '.$className. ' not recognised'); return false;}checkJavaExtension();$compileManager = new JavaClass("net.sf.jasperreports.engine.JasperCompileManager");$report = $compileManager->compileReport(realpath("test.jrxml"));$fillManager = new JavaClass("net.sf.jasperreports.engine.JasperFillManager");$params = new Java("java.util.HashMap");$params->put("text", "Hello World!");$params->put("number", 3.00);$params->put("date", convertValue("2010-01-01 0:0:0", "java.sql.Timestamp"));$emptyDataSource = new Java("net.sf.jasperreports.engine.JREmptyDataSource");$jasperPrint = $fillManager->fillReport($report, $params, $emptyDataSource);$outputPath = realpath(".")."/"."output.pdf";$exportManager = new JavaClass("net.sf.jasperreports.engine.JasperExportManager");$exportManager->exportReportToPdfFile($jasperPrint, $outputPath);header("Content-type: application/pdf");readfile($outputPath);unlink($outputPath);?>[/code]My test Jasper report looks like: <?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20"> <property name="ireport.scriptlethandling" value="0"/> <property name="ireport.encoding" value="UTF-8"/> <import value="net.sf.jasperreports.engine.*"/> <import value="java.util.*"/> <import value="net.sf.jasperreports.engine.data.*"/> <parameter name="text" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA[""]]></defaultValueExpression> </parameter> <parameter name="number" class="java.lang.Double" isForPrompting="false"> <defaultValueExpression><![CDATA[new java.lang.Double(0)]]></defaultValueExpression> </parameter> <parameter name="date" class="java.util.Date" isForPrompting="false"/> <background> <band splitType="Stretch"/> </background> <title> <band height="50" splitType="Stretch"/> </title> <pageHeader> <band height="50" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="30" splitType="Stretch"/> </columnHeader> <detail> <band height="223" splitType="Stretch"> <textField isBlankWhenNull="false"> <reportElement key="textField-1" x="75" y="17" width="312" height="100"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="18"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Passed Text: "+$P{text}]]></textFieldExpression> </textField> <textField isBlankWhenNull="false"> <reportElement key="textField-2" x="78" y="130" width="316" height="32"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["And a number: "+$P{number}]]></textFieldExpression> </textField> <textField isBlankWhenNull="false"> <reportElement key="textField-3" x="77" y="173" width="316" height="32"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["And a date: "+$P{date}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="30" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="50" splitType="Stretch"/> </pageFooter> <lastPageFooter> <band height="50" splitType="Stretch"/> </lastPageFooter> <summary> <band height="50" splitType="Stretch"/> </summary></jasperReport>[/code]Any help is appreciated. Many thanks.
  2. You can use two sub reports each handling its own section in your main Driver report e.g. a sub report for section A and a sub report for section B Or you can use report groups to achieve same as your Excel spreadsheet.
  3. From my experience, it only happens when your display sections in sub-report contains extra HEIGHT. Or maybe you are using page break at the end of your sub-report. Thanks.
  4. I have used crosstab in one of my report. Is it possible to achieve what I have described in right side of the image below? My crosse tab originally continues its printing on next page where as I have almost 60% of the page 1 blank. Any possibility I can tweak my crosstab so it first uses the space available on the same page instead of going on to next page? Any help will be appreciated. Thanks.
  5. I had to add a row group and column group for it to work. Thanks for the solution.
  6. I am unable to try this as we are using Jasper with our PHP application and I have linux server ... I will have issues getting this working on our server .... but I managed to get this working after tweaking my SQL query that I use to retrieve my data. Thanks for your help anyway.
  7. I managed to get this working. I realised that the dataset returned via my SQL queries were not having entry for each columns e.g. I was having a row returned for COLUMN 1 and COLUMN 2 for ROW1 but then onwards I was either having a row returned for COLUMN 1 or a row returned for COLUMN 2 by my SQL. Something like General Expenditure Internal Only General Repairs 5 5 Cleaning 5 Accountancy 5 Insurance 5 and so on .... I changed my SQL query so it returns 0 if there is no data to be retrieved for COLUMN 1 or COLUMN 2 and that made it working in the sorting order I want havin the 'Data is pre-sorted' flag checked for the crosstab. LIKE General Expenditure Internal Only General Repairs 5 5 Cleaning 5 0 Accountancy 0 5 Insurance 5 0 Hope this is helpful for others.
  8. Hi, I want to add a Comment column after the Total column in crosstab. Is it possible? If YES then can someone please help me out how? I have found a similar question asked ages ago but no asnwer onit. What I am looking is similar to what is being asked in the post below: http://community.jaspersoft.com/questions/532287/add-data-after-column-total-crosstab Hope to hear soon. Thanks.
  9. Thank you lucianc for your reply. I have raised the ticket on tracker which is: http://community.jaspersoft.com/ireport-designer/issues/2584 I will try the solution you suggested. Will let you know how it went. Thanks
  10. Thanks for your reply lucianc Here are the files attached. The report file is attached as .TXT file as the forum didn't allowed me to upload the JRXML format file. I have also attached the CSV data files which is used with main report SQL and sub-dataset SQL. Hope to hear soon. Thanks. /sites/default/files/files/Report%20File.txt /sites/default/files/files/Sub%20Data%20Set%20CSV.csv /sites/default/files/files/Main%20report%20CSV(1).csv
  11. I tried the option of concatenating the display_order value with service_name column to get the sorting done correctly. But it takes whole as string and does the sorting as: 22 - Electricity 25 - Accountancy Fees 26 - Management Services ...................... ...................... 4 - General Building Repairs/Works where as I need the service name to displayed in the order of display_order field
  12. Hi, I am using crosstab in my report and I am having problem with the data it displays. It repeats the column on the report when I use 'Data is pre-sorted' flag on crosstab. Please check the image attached. When I uncheck the 'Data is pre-sorted' box, I get the columns correctly but the rows are ordered alphabetically whereas I want rows in the order shown in the image. The data passed to the crosstab via Dataset is: The sorting order I am using at the moment is: ORDER BY display_order ASC, block_schedule_ID ASC; Can anyone please help. Thanks.
  13. You need to add you sub-report under the DETAILS section of your master report. this way your subreport will be invoked for each child giving you the required output. I hope this helps.
  14. I have managed to resolve the issue MYSELF. All I did was to uninstall all type of Java/JDK softwares, Uninstall All iReprot softwares .... Delete every entry from registry regarding Java and iReport/JasperSoft ... Delete every entry from msconfig if found ... Delete iReport/JasperSoft folder from Program Files and Delete Java folders from Program Files as well ... Do a fresh Installation of JDK and then iReport ... and all works like a charm :) I have upgraded from iReport 3.7.0 to 4.7.0 recently. When I open iReport 4.7.0 or any of my existing report in it, it fails giving me the designer window and shows error messages. I have attached the error messages as separate files and the log file with this ticket. I have been struggling to upgrade my iReport Designer software from 3.7.0 for every version released afterwards. The error is same, unable to open reports with designer palletes and windows, and gets error messages everytime I run the software. I have tried all options from time to time but no luck. Can someone please help me on this. Thanks. Post Edited by sumairrana at 08/30/2012 10:17
  • Create New...