Jump to content

uouser

Members
  • Posts

    29
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by uouser

  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 http://127.0.0.1:8080//JavaBridge/java/Java.inc(232):java_ThrowExceptionProxyFactory->getProxy(10, 'java.lang.Class', 'T', true)#1 http://127.0.0.1:8080//JavaBridge/java/Java.inc(360): java_Arg->getResult(true)#2 http://127.0.0.1:8080//JavaBridge/java/Java.inc(366): java_Client->getWrappedResult(true)#3 http://127.0.0.1:8080//JavaBridge/java/Java.inc(560): java_Client->getResult()#4 http://127.0.0.1:8080//JavaBridge/java/Java.inc(1752): java_Client->invokeMethod(7, 'fillReport', Array)#5 http://127.0.0.1:8080//JavaBridge/java/Java.inc(1851): java_JavaProxy->__call('fillReport', Array)#6 http://127.0.0.1:8080//JavaBridge/java/Java.inc(1999): 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("http://127.0.0.1:$port/java/Java.inc")))            {echo "3 <BR><BR>";                return "java extension not installed.";            }        }        else        {echo "4 <BR><BR>";            if(!(@include_once("http://127.0.0.1:8080//JavaBridge/java/Java.inc")))            {echo "5 <BR><BR>";                require_once("http://127.0.0.1:$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. 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.

     

     

    Crosstabfeature.png.8b07d639e6b31f8726ec78fe13a71126.png

  4. 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.
  5. 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.

  6. 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

  7. 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

  8. 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.

     

    crosstab-issue.png.e7fb3b6b55db610a604ad2b1116a8f1b.png

     

    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:

     

    crosstabresultset.png.06feceeb085cffa14842ab8d0a5888a0.png

    The sorting order I am using at the moment is:

    ORDER BY display_order ASC, block_schedule_ID ASC;

    Can anyone please help. Thanks.

  9. 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
  10. 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:18
  11. Thanks for coming back with a response. I tried this option and I get 'Error: SQL problems: You have an error in your SQL syntax; check the manual that corresponds to your MySQL version for the right syntax to use near toString()' error message.

    I am passing all string values in the collection. it seems like it doesn't accept any function called after the parameter.

     

    Thanks for the help in advance.

  12. Hi,

     

    I have created a new input parameter in my report as java.util.Collection. I am using it in my SQL query as:

    SELECT parameter from table

    Where parameter1 IN ($P{collection_input}.toString())
     

    I am getting error in query designer as 'null.toString()' does not exist. If I don't use toString() then the report just simply doesn't work at all.

     

    I tried to search on the forum and couldn't find any help. Does anyone knows how to deal with Collection opbject as input parameter in iReport? Thanks for help in advance.

  13. Hi,

    I have upgraded my iReport software from 3.7 to 4.x version. I have quite a lot reports created in 3.7 and now I get this error when I open any report or create a blnak new report. The error is:

     



    Error loading the report template
     

    Message:
        java.lang.reflect.InvocationTargetException
    Level:
        SEVERE
    Stack Trace:
    null
        java.awt.EventQueue.invokeAndWait(EventQueue.java:998)
        javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1320)
        com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:526)
        org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
        org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
    net.sf.jasperreports.engine.convert.ReportConverter. (Lnet/sf/jasperreports/engine/JRReport;Z)V
        com.jaspersoft.ireport.designer.ReportObjectScene.setJasperDesign(ReportObjectScene.java:148)
        com.jaspersoft.ireport.designer.ReportDesignerPanel.setJasperDesign(ReportDesignerPanel.java:154)
        com.jaspersoft.ireport.designer.JrxmlVisualView$3.run(JrxmlVisualView.java:530)
        java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
        java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        java.awt.EventDispatchThread.run(EventDispatchThread.java:122)



    Any help in this regard will be highly appreciated. Thanks.

  14. It is frustrating .... I re-installed iReport again .... no joy whatsoever .... surely someone knows answer to this ... it is not a strange issue ... i am sure many people might have faced this issue. I have pasted the error below

    Code:
    Error loading the report template Message:    java.lang.reflect.InvocationTargetExceptionLevel:    SEVEREStack Trace:null    java.awt.EventQueue.invokeAndWait(EventQueue.java:998)    javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1320)    com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:526)    org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)    org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)net.sf.jasperreports.engine.convert.ReportConverter. (Lnet/sf/jasperreports/engine/JRReport;Z)V    com.jaspersoft.ireport.designer.ReportObjectScene.setJasperDesign(ReportObjectScene.java:148)    com.jaspersoft.ireport.designer.ReportDesignerPanel.setJasperDesign(ReportDesignerPanel.java:154)    com.jaspersoft.ireport.designer.JrxmlVisualView$3.run(JrxmlVisualView.java:530)    java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)    java.awt.EventQueue.dispatchEvent(EventQueue.java:597)    org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)    java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)    java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)    java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Post Edited by sumairrana at 07/15/2011 11:32
  15. Thanks for your reply gglulu .... I am using MySQL .... I tried this but no success .... it again puts null when processed .....I tried to put default value as welll ... it works with default value but then it never takes the value i entered at run time ..... it only produced report every time with default value ..... Anything else you may think of ... or is it not allowed to use parameter in select clause ???
×
×
  • Create New...