XML4C完美兼容中文的补充

博客围绕XML4C兼容中文的问题展开。参考文章修改源码后,Debug版本能完美兼容中文,但Release版本解析混乱。经跟踪发现问题出在修改处,通过在mbstowcs前设置本地环境服务解决,还可将mbstowcs和wcstombs替换为Windows API解决问题。

 

XML4C完美兼容中文的补充

 

xml4c兼容中文的问题一直是大家比较头疼的问题,网上也有很多关于这方面的讨论,但是一直没有太好的结论。在IBM Developerworks的网站上,找到了邹月明先生的一篇文章《剖析XML4c源码,完美兼容中文XML》,该文章对Xml4c的源码进行了剖析,对xml4c的源码进行了修改,从而达到了对中文兼容的目的。我也针对Xml4c的源码按照文章中的说法进行了修改,这种方法在我的debug版本中确实完美的解决了xml4c对中文的完美兼容。但是,问题出现了在我的Release版本中,对中文的解析出现了混乱。

为了能够弄清楚问题的所在,决定对xml4crelease版本进行跟踪,结果发现问题就是出在邹月明先生的文章中所指出的修改之处。该代码对于DebugRelease返回的是不同的结果(首先需要声明的是,我已经在使用该库之前调用了setlocale ( LC_ALL, “Chinese-siimplified” ) ),只要字符串中包含有中文,在Release版本下calcRequiredSize ( const char* const srcText )函数种调用mbstowcs返回的结果就是不正确。下面是《剖析XML4C源码》修改的函数calcRequiredSize代码:

 

unsigned int Win32LCPTranscoder::calcRequiredSize(const char* const srcText)

{

/*

if(!srcText)

return 0;

unsigned charLen = ::mblen(srcText, MB_CUR_MAX);

if(charLen == -1)

return 0;

else if(charLen != 0 )

charLen = strlen(srcText)/charLen;

if(charLen == -1)

return 0;

return charLen;

*/

 

if(! srcText){

return 0;

}

unsigned int retVal = ::mbstowcs( 0, srcText, 0 );

if ( retVal == -1) {

return 0;

}

return retVal;

}

 

这段代码在Debug下正确运行没有问题,但是在Release下,计算长度就是会出现问题,得到的结果不正确。开始以为是在程序开始的设置的本地环境服务被修改了,可是跟踪代码的时候发现并没有被改变,这让人感到很迷惑,不知道是什么原因造成的。当在mbstowcs前设置当前的本地环境服务(setlocale(LC_ALL, NULL );)之后,函数mbstowcs就能够正确的工作了,如果有谁知道原因,可以来信告知(email: flyelfsky@hotmail.com)

于是,修改之后的代码就如下了:

unsigned int Win32LCPTranscoder::calcRequiredSize(const char* const srcText)

{

 

if(! srcText){

return 0;

}

#ifndef _DEBUG

// 确保在release下能够得到正确的结果

setlocale ( LC_ALL, NULL );

#endif

unsigned int retVal = ::mbstowcs( 0, srcText, 0 );

if ( retVal == -1) {

return 0;

}

return retVal;

}

 

当然了,不仅仅是这个函数需要添加这个,对于所有的mbstowcs函数的前面都要添加这个代码:setlocale(LC_ALL, NULL );下面列出的就是需要修改的函数:

unsigned int Win32LCPTranscoder::calcRequiredSize(const char* const srcText

                                                  , MemoryManager* const manager)

char* Win32LCPTranscoder::transcode(const XMLCh* const toTranscode);

char* Win32LCPTranscoder::transcode(const XMLCh* const toTranscode,

                                    MemoryManager* const manager)

XMLCh* Win32LCPTranscoder::transcode(const char* const toTranscode)

XMLCh* Win32LCPTranscoder::transcode(const char* const toTranscode,

                                     MemoryManager* const manager)

bool Win32LCPTranscoder::transcode( const   char* const     toTranscode

                                    ,       XMLCh* const    toFill

                                    , const unsigned int    maxChars

                                    , MemoryManager* const  manager)

bool Win32LCPTranscoder::transcode( const   XMLCh* const    toTranscode

                                    ,       char* const     toFill

                                    , const unsigned int    maxBytes

                                    , MemoryManager* const  manager)

 

 

使用函数mbstowcswcstombs进行转换,只不过是为了移植的方便,而在win32下已经提供了另外的api来进行转换:WideCharToMultiByteMultiByteToWideChar,在这些转换函数中,把mbstowcs替换为MultiByteToWideChar,把wcstombs替换为WideCharToMultiByte。这样重新编译后就不会出现这个问题了。

 

附录:修改之后的Win32TransService.cpp的部分寒暑内容

 

// ---------------------------------------------------------------------------

//  Win32LCPTranscoder: Implementation of the virtual transcoder interface

// ---------------------------------------------------------------------------

unsigned int Win32LCPTranscoder::calcRequiredSize(const char* const srcText

                                                  , MemoryManager* const manager)

{

     if ( ! srcText )

     {

            return 0;

     }

 

#ifdef _WIN32

     unsigned int retVal = ::MultiByteToWideChar ( CP_ACP,

                                                                                    0,

                                                                                    srcText,

                                                                                    -1,

                                                                                    NULL,

                                                                                    0 );

#else

#ifndef _DEBUG

     setlocale( LC_ALL, "" );

#endif

     unsigned int retVal = ::mbstowcs( 0, srcText, 0 );

#endif

     if ( retVal == -1 )

     {

            return 0;

     }

     return retVal;

}

 

char* Win32LCPTranscoder::transcode(const XMLCh* const toTranscode)

{

    if (!toTranscode)

        return 0;

 

    char* retVal = 0;

    if (*toTranscode)

    {

        // Calc the needed size

        const unsigned int neededLen = calcRequiredSize(toTranscode);

 

        // Allocate a buffer of that size plus one for the null and transcode

        retVal = new char[neededLen + 1];

#ifdef _WIN32

            ::WideCharToMultiByte ( CP_ACP,

                                                      0,

                                                      toTranscode,

                                                      -1,

                                                      retVal,

                                                      neededLen,

                                                      "",

                                                      NULL );

#else

#ifndef _DEBUG

     setlocale( LC_ALL, "" );

#endif

        ::wcstombs(retVal, toTranscode, neededLen + 1);

#endif

           

        // And cap it off anyway just to make sure

        retVal[neededLen] = 0;

    }

    else

    {

        retVal = new char[1];

        retVal[0] = 0;

    }

    return retVal;

}

 

char* Win32LCPTranscoder::transcode(const XMLCh* const toTranscode,

                                    MemoryManager* const manager)

{

    if (!toTranscode)

        return 0;

 

    char* retVal = 0;

    if (*toTranscode)

    {

        // Calc the needed size

        const unsigned int neededLen = calcRequiredSize(toTranscode, manager);

 

        // Allocate a buffer of that size plus one for the null and transcode

        retVal = (char*) manager->allocate((neededLen + 1) * sizeof(char)); //new char[neededLen + 1];

#ifdef _WIN32

            ::WideCharToMultiByte ( CP_ACP,

                                                      0,

                                                      toTranscode,

                                                      -1,

                                                      retVal,

                                                      neededLen,

                                                      "",

                                                      NULL );

#else

#ifndef _DEBUG

     setlocale( LC_ALL, "" );

#endif

        ::wcstombs(retVal, toTranscode, neededLen + 1);

#endif

 

        // And cap it off anyway just to make sure

        retVal[neededLen] = 0;

    }

    else

    {

        retVal = (char*) manager->allocate(sizeof(char)); //new char[1];

        retVal[0] = 0;

    }

 

    return retVal;

}

 

XMLCh* Win32LCPTranscoder::transcode(const char* const toTranscode)

{

    if (!toTranscode)

        return 0;

 

    XMLCh* retVal = 0;

    if (*toTranscode)

    {

        // Calculate the buffer size required

        const unsigned int neededLen = calcRequiredSize(toTranscode);

        if (neededLen == 0)

        {

            retVal = new XMLCh[1];

            retVal[0] = 0;

            return retVal;

        }

 

        // Allocate a buffer of that size plus one for the null and transcode

        retVal = new XMLCh[neededLen + 1];

#ifdef _WIN32

            ::MultiByteToWideChar ( CP_ACP,

                                                      0,

                                                      toTranscode,

                                                      -1,

                                                      retVal,

                                                      neededLen );

#else

#ifndef _DEBUG

     setlocale( LC_ALL, "" );

#endif  

        ::mbstowcs(retVal, toTranscode, neededLen + 1);

#endif

           

        // Cap it off just to make sure. We are so paranoid!

        retVal[neededLen] = 0;

    }

    else

    {

        retVal = new XMLCh[1];

        retVal[0] = 0;

    }

    return retVal;

}

 

XMLCh* Win32LCPTranscoder::transcode(const char* const toTranscode,

                                     MemoryManager* const manager)

{

    if (!toTranscode)

        return 0;

 

    XMLCh* retVal = 0;

    if (*toTranscode)

    {

        // Calculate the buffer size required

        const unsigned int neededLen = calcRequiredSize(toTranscode, manager);

        if (neededLen == 0)

        {

            retVal = (XMLCh*) manager->allocate(sizeof(XMLCh)); //new XMLCh[1];

            retVal[0] = 0;

            return retVal;

        }

 

        // Allocate a buffer of that size plus one for the null and transcode

        retVal = (XMLCh*) manager->allocate((neededLen + 1) * sizeof(XMLCh)); //new XMLCh[neededLen + 1];

#ifdef _WIN32

            ::MultiByteToWideChar ( CP_ACP,

                                                      0,

                                                      toTranscode,

                                                      -1,

                                                      retVal,

                                                      neededLen );

#else

#ifndef _DEBUG

     setlocale( LC_ALL, "" );

#endif

        ::mbstowcs(retVal, toTranscode, neededLen + 1);

#endif

           

        // Cap it off just to make sure. We are so paranoid!

        retVal[neededLen] = 0;

    }

    else

    {

        retVal = (XMLCh*) manager->allocate(sizeof(XMLCh)); //new XMLCh[1];

        retVal[0] = 0;

    }

    return retVal;

}

 

bool Win32LCPTranscoder::transcode( const   char* const     toTranscode

                                    ,       XMLCh* const    toFill

                                    , const unsigned int    maxChars

                                    , MemoryManager* const  manager)

{

    // Check for a couple of psycho corner cases

    if (!toTranscode || !maxChars)

    {

        toFill[0] = 0;

        return true;

    }

 

    if (!*toTranscode)

    {

        toFill[0] = 0;

        return true;

    }

 

    // This one has a fixed size output, so try it and if it fails it fails

 

#ifdef _WIN32

     size_t to_ = ::MultiByteToWideChar ( CP_ACP,

                                                                    0,

                                                                    toTranscode,

                                                                    -1,

                                                                    toFill,

                                                                    maxChars );

#else

#ifndef _DEBUG

     setlocale( LC_ALL, "" );

#endif

     size_t to_ = ::mbstowcs(toFill, toTranscode, maxChars + 1);

#endif

 

     return ( to_ != size_t(-1) );

     //

}

 

bool Win32LCPTranscoder::transcode( const   XMLCh* const    toTranscode

                                    ,       char* const     toFill

                                    , const unsigned int    maxBytes

                                    , MemoryManager* const  manager)

{

    // Watch for a couple of pyscho corner cases

    if (!toTranscode || !maxBytes)

    {

        toFill[0] = 0;

        return true;

    }

 

    if (!*toTranscode)

    {

        toFill[0] = 0;

        return true;

    }

 

    // This one has a fixed size output, so try it and if it fails it fails

 

     //

#ifdef _WIN32

     size_t to_ = ::WideCharToMultiByte ( CP_ACP,

                                                                    0,

                                                                    toTranscode,

                                                                    -1,

                                                                    toFill,

                                                                    maxBytes,

                                                                    "",

                                                                    NULL );

#else

#ifndef _DEBUG

     setlocale( LC_ALL, "" );

#endif

     size_t to_ = ::wcstombs(toFill, toTranscode, maxBytes + 1);

#endif

     if ( to_ == size_t(-1) )

     {

            return false;

     }

    

    // Cap it off just in case

    toFill[maxBytes] = 0;

    return true;

}

 

 

<?xml version="1.0" encoding="UTF-8"?> <!-- Created with Jaspersoft Studio version 6.5.0.final using JasperReports Library version 6.5.0 --> <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="CE74O1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="560" leftMargin="17" rightMargin="17" topMargin="20" bottomMargin="20" whenResourceMissingType="Error" uuid="f570145a-65a9-4e7e-ba6e-5520ee8382ef"> <property name="net.sf.jasperreports.export.pdf.exclude.key.TransparentImage" value=""/> <property name="net.sf.jasperreports.export.pdf.tagged" value="true"/> <property name="net.sf.jasperreports.export.pdfa.conformance" value="pdfa1a"/> <property name="net.sf.jasperreports.export.pdfa.icc.profile.path" value="C:\project\JavaProject\MOADoms\fonts\AdobeRGB1998.icc"/> <property name="ireport.scriptlethandling" value="0"/> <property name="ireport.encoding" value="UTF-8"/> <property name="ireport.zoom" value="2.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <property name="net.sf.jasperreports.export.pdf.force.linebreak.policy" value="true"/> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> <property name="com.jaspersoft.studio.unit." value="pixel"/> <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/> <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/> <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/> <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/> <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/> <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/> <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/> <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/> <property name="net.sf.jasperreports.print.keep.full.text" value="true"/> <property name="net.sf.jasperreports.export.xls.font.size.fix.enabled" value="true"/> <import value="net.sf.jasperreports.engine.*"/> <import value="java.util.*"/> <import value="net.sf.jasperreports.engine.data.*"/> <import value="jcs.doms.JR.JR_Common.*"/> <style name="myfont" isDefault="true" fontName="標楷體" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <parameter name="parameter0" class="java.lang.String" isForPrompting="false"/> <parameter name="parameter1" class="java.lang.String" isForPrompting="false"/> <queryString> <![CDATA[SELECT BD_RECENO,BD_RECEDATE,BD_FINALDTE,BD_COMPDATE, BD_ATTRCODE,BD_THEME,IP_DEPTNAME AS BD_CHARGEDPNM, BD_CHARGEPE_NM, BD_CHARGEDP, CASE WHEN (BD_SENDTYPE IS NOT NULL AND BD_SENDTYPE = '1') THEN '發文歸檔' ELSE (CASE WHEN (BD_FILETYPE IS NOT NULL AND BD_FILETYPE = '1') THEN '存查歸檔' ELSE '' END) END AS ETYPE , '一般' AS ATTRCODE FROM DOMS.DOC_BASEDATA_VIEW JOIN DOMS.DPT_INSEDEPT ON BD_CHARGEDP=IP_DEPTCODE WHERE ( BD_SENDTYPE > '' ) AND BD_HANDSTAT<>'4' AND BD_ORIGIN <= '5' AND (BD_CHARGEDP NOT IN ('B1','B2','B3','B4','B5','B6','B7','B8','B9','D0','E0')) AND (BD_ATTRCODE IN ('A','P','Q')) AND (BD_SPECDOC <> 'Y' OR BD_SPECDOC IS NULL) AND (BD_APPLYDATE IS NULL OR BD_APPLYDATE = 0) AND BD_HANDSTAT <> '4' AND (BD_COMPDATE >= 990101 AND BD_COMPDATE <= 991223 ) AND IP_DEPTTYPE='H' AND BD_DECISION = '1' ORDER BY BD_CHARGEDP ASC,BD_SUBDEPT ASC,BD_CHARGEPE ASC]]> </queryString> <field name="BD_RECENO" class="java.lang.String"/> <field name="BD_DESIDATE" class="java.lang.Integer"/> <field name="BD_CHARGEDP_NM" class="java.lang.String"/> <field name="IP_DEPTNAME" class="java.lang.String"/> <field name="BD_THEME" class="java.lang.String"/> <field name="IP_DEPTCODE" class="java.lang.String"/> <group name="chargedp" isStartNewPage="true"> <groupExpression><![CDATA[$F{IP_DEPTCODE}]]></groupExpression> <groupHeader> <band splitType="Stretch"/> </groupHeader> <groupFooter> <band splitType="Stretch"/> </groupFooter> </group> <background> <band splitType="Stretch"/> </background> <title> <band splitType="Stretch"/> </title> <pageHeader> <band height="66" splitType="Prevent"> <textField isBlankWhenNull="false"> <reportElement key="textField" style="myfont" positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="0" width="560" height="36" printWhenGroupChanges="chargedp" uuid="9d7591cc-64cd-4c67-b135-7861521057c0"> <property name="com.jaspersoft.studio.unit.x" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> </reportElement> <box padding="1"> <pen lineWidth="1.0"/> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" markup="html"> <font size="16"/> </textElement> <textFieldExpression><![CDATA[$P{parameter1} + $F{IP_DEPTNAME} + "決行案件清單"]]></textFieldExpression> </textField> <staticText> <reportElement key="staticText-6" style="myfont" x="0" y="36" width="40" height="30" uuid="679b43bd-58b2-4140-b959-1a989e5d0903"> <property name="com.jaspersoft.studio.unit.y" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> </reportElement> <box> <pen lineWidth="1.0"/> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <text><![CDATA[序號]]></text> </staticText> <staticText> <reportElement key="staticText-7" style="myfont" stretchType="RelativeToTallestObject" x="40" y="36" width="110" height="30" uuid="11193ff5-3b0a-4abb-a355-c55120dcb69f"> <property name="com.jaspersoft.studio.unit.y" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> </reportElement> <box> <pen lineWidth="1.0"/> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <text><![CDATA[承辦單位]]></text> </staticText> <staticText> <reportElement key="staticText-8" style="myfont" x="150" y="36" width="70" height="30" uuid="44c86de7-0182-4d3e-ba5e-093e53523b80"> <property name="com.jaspersoft.studio.unit.y" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> </reportElement> <box> <pen lineWidth="1.0"/> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <text><![CDATA[決行日期]]></text> </staticText> <staticText> <reportElement key="staticText-9" style="myfont" x="220" y="36" width="90" height="30" uuid="69e41a58-7a8c-45f2-a77f-0dbce7ae80e3"> <property name="com.jaspersoft.studio.unit.y" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> </reportElement> <box> <pen lineWidth="1.0"/> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <text><![CDATA[文號]]></text> </staticText> <staticText> <reportElement key="staticText-10" style="myfont" stretchType="RelativeToBandHeight" x="310" y="36" width="250" height="30" uuid="01ff2c2a-c92d-4af3-93fd-1a5e6a2ff2c5"> <property name="com.jaspersoft.studio.unit.y" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> </reportElement> <box> <pen lineWidth="1.0"/> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <text><![CDATA[主旨]]></text> </staticText> </band> </pageHeader> <columnHeader> <band splitType="Stretch"> <property name="com.jaspersoft.studio.layout"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </band> </columnHeader> <detail> <band height="40" splitType="Prevent"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement style="myfont" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="40" height="40" isPrintWhenDetailOverflows="true" printWhenGroupChanges="chargedp" uuid="8d4293d3-f655-4b51-b090-8c56e55f3cda"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </reportElement> <box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0"> <pen lineWidth="1.0"/> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <textFieldExpression><![CDATA[$V{chargedp_COUNT}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement style="myfont" positionType="Float" stretchType="RelativeToBandHeight" x="40" y="0" width="110" height="40" isPrintWhenDetailOverflows="true" uuid="220e0556-8315-487d-bbef-cfc3643e516c"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </reportElement> <box> <pen lineWidth="1.0"/> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <textFieldExpression><![CDATA[$F{BD_CHARGEDP_NM}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement style="myfont" positionType="Float" stretchType="RelativeToBandHeight" x="150" y="0" width="70" height="40" isPrintWhenDetailOverflows="true" uuid="860e81bd-88fb-4d81-8cb7-0185af1963be"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </reportElement> <box> <pen lineWidth="1.0"/> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <textFieldExpression><![CDATA[$F{BD_DESIDATE}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement style="myfont" positionType="Float" stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" x="220" y="0" width="90" height="40" isPrintWhenDetailOverflows="true" uuid="743d11c0-cf98-4343-8bd9-d6ba722f5366"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </reportElement> <box> <pen lineWidth="1.0"/> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <textFieldExpression><![CDATA[$F{BD_RECENO}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement style="myfont" positionType="Float" stretchType="RelativeToBandHeight" x="310" y="0" width="250" height="40" isPrintWhenDetailOverflows="true" uuid="5c1f90eb-81ed-4cc8-b016-63566a174541"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </reportElement> <box topPadding="3" leftPadding="0" bottomPadding="3" rightPadding="0"> <pen lineWidth="1.0"/> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="12"/> <paragraph lineSpacing="Single" lineSpacingSize="1.6"/> </textElement> <textFieldExpression><![CDATA["\n" + $F{BD_THEME} + "\n"]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band splitType="Stretch"/> </pageFooter> <summary> <band splitType="Stretch"/> </summary> </jasperReport> 還是沒辦法
最新发布
10-16
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值