本文介绍了运行报告时发出警告:找到命名空间的两个组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 JasperReports 报告时遇到问题。我运行了关于我的程序的报告,它有效,但是有这样的错误消息

I have problem with report using JasperReports. I ran report on my program, it works, but there were error message just like this

net.sf.jasperreports.engine.component.ComponentsEnvironment findComponentBundles

警告:找到名称空间为http://的两个组件jasperreports.sourceforge.net/jasperreports/components

当我搜索任何与我相同的推荐时,没有一个是解决方案。你知道怎么解决这个问题吗?

When I searched any recommendation as same as mine, none is solution. Do you know how to fix this?

这个'jrxml文件

<?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="imp1_bln" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <parameter name="thn_proses" class="java.lang.String"/>
    <parameter name="bln_proses" class="java.lang.Integer"/>
    <queryString>
        <![CDATA[SELECT DISTINCT
     m_negara."id_negara" AS ID_Negara,
     m_negara."nama_negara" AS Nama_Negara,
     import_det."netto_hs" AS Curr_Net,
     SUM(import_det.netto_hs)AS Cumm_Net,
     import_det."cif_hs_us" AS Curr_CIF,
     SUM(import_det.cif_hs_us)AS Cumm_CIF,
     batch_hdr."bln_proses" AS batch_hdr_bln_proses,
     batch_hdr."thn_proses" AS batch_hdr_thn_proses
FROM
     m_hs10digit, m_negara, import_det, batch_hdr, import

 WHERE

    "dbo".import.negara_pemasok=dbo.m_negara.id_negara AND dbo.import_det.sk_import=dbo.import.sk_import
    AND dbo.import.sk_batch=dbo.batch_hdr.sk_batch
    AND dbo.batch_hdr.bln_proses between 01 and $P{bln_proses}

GROUP BY
    m_negara."id_negara",
    m_negara."nama_negara",
    import_det."netto_hs",
    import_det."cif_hs_us",
    batch_hdr."bln_proses",
    batch_hdr."thn_proses"]]>
    </queryString>
    <field name="ID_Negara" class="java.lang.String"/>
    <field name="Nama_Negara" class="java.lang.String"/>
    <field name="Curr_Net" class="java.lang.Double"/>
    <field name="Cumm_Net" class="java.lang.Double"/>
    <field name="Curr_CIF" class="java.lang.Double"/>
    <field name="Cumm_CIF" class="java.lang.Double"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="93" splitType="Stretch">
            <image>
                <reportElement x="1" y="2" width="146" height="91"/>
                <imageExpression class="java.lang.String"><![CDATA["coffee.jpg"]]></imageExpression>
            </image>
            <staticText>
                <reportElement x="146" y="58" width="410" height="35"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="12" isItalic="false" pdfFontName="Times-Roman"/>
                </textElement>
                <text><![CDATA[Tabel Impor Menurut Negara Asal (Import By Country of Origin)]]></text>
            </staticText>
        </band>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="79" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="0" width="41" height="19"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="12" pdfFontName="Times-Roman"/>
                </textElement>
                <text><![CDATA[Bulan :]]></text>
            </staticText>
            <staticText>
                <reportElement x="64" y="0" width="39" height="19"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="12" pdfFontName="Times-Roman"/>
                </textElement>
                <text><![CDATA[Tahun:]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="40" width="56" height="39"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Kode Negara]]></text>
            </staticText>
            <staticText>
                <reportElement x="146" y="59" width="90" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Bulan Ini]]></text>
            </staticText>
            <staticText>
                <reportElement x="235" y="59" width="129" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Kumulatif]]></text>
            </staticText>
            <staticText>
                <reportElement x="55" y="40" width="92" height="39"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Negara Asal]]></text>
            </staticText>
            <staticText>
                <reportElement x="363" y="59" width="50" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Bulan Ini]]></text>
            </staticText>
            <staticText>
                <reportElement x="412" y="59" width="144" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Kumulatif]]></text>
            </staticText>
            <staticText>
                <reportElement x="146" y="40" width="218" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Berat Bersih (Netto)]]></text>
            </staticText>
            <staticText>
                <reportElement x="363" y="40" width="193" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[CIF (US $)]]></text>
            </staticText>
            <textField>
                <reportElement x="102" y="0" width="35" height="19"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.String"><![CDATA[$P{thn_proses}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="40" y="0" width="25" height="19"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Integer"><![CDATA[$P{bln_proses}]]></textFieldExpression>
            </textField>
        </band>
    </columnHeader>
    <detail>
        <band height="32" splitType="Stretch">
            <textField>
                <reportElement x="1" y="-1" width="55" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.String"><![CDATA[$F{ID_Negara}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="146" y="-1" width="90" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Double"><![CDATA[$F{Curr_Net}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="235" y="-1" width="129" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Double"><![CDATA[$F{Cumm_Net}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="55" y="-1" width="92" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.String"><![CDATA[$F{Nama_Negara}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="363" y="0" width="50" height="19"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Double"><![CDATA[$F{Curr_CIF}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="412" y="-1" width="144" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Double"><![CDATA[$F{Cumm_CIF}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>


推荐答案

这意味着你有几个 jar 文件...只需使用:

It means that you have several jar files in your JasperReports Library classpath... just use:


  • commons-beanutils-1.8.0

  • commons-collections-2.1.1

  • commons-digester-1.7

  • commons-javaflow-20060411

  • commons-logging-1.0.4

  • groovy-all-1.7.5

  • iText-2.1.7

  • jasperreports-4.5.0(任何版本)

  • png-encoder-1.5

  • poi-3.7-20101029(或poi-3.6)

  • commons-beanutils-1.8.0
  • commons-collections-2.1.1
  • commons-digester-1.7
  • commons-javaflow-20060411
  • commons-logging-1.0.4
  • groovy-all-1.7.5
  • iText-2.1.7
  • jasperreports-4.5.0 (any version)
  • png-encoder-1.5
  • poi-3.7-20101029 (Or poi-3.6)

并且问题解决了......

and problem solved...

这篇关于运行报告时发出警告:找到命名空间的两个组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 13:04