ireport生成pdf文件

原创 2017年01月17日 14:08:26

ireport生成pdf文件

  1. 生成jrxml

    工具:iReport-4.6.0
    范例如下:

<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
         name="a"
         columnCount="1"
         printOrder="Vertical"
         orientation="Portrait"
         pageWidth="535"
         pageHeight="533"
         columnWidth="532"
         columnSpacing="0"
         leftMargin="0"
         rightMargin="0"
         topMargin="0"
         bottomMargin="0"
         whenNoDataType="NoPages"
         isTitleNewPage="false"
         isSummaryNewPage="false">
    <property name="ireport.scriptlethandling" value="0" />
    <property name="ireport.encoding" value="UTF-8" />
    <import value="java.util.*" />
    <import value="net.sf.jasperreports.engine.*" />
    <import value="net.sf.jasperreports.engine.data.*" />

    <parameter name="JasperfishSubReportLocation" isForPrompting="true" class="net.sf.jasperreports.engine.JasperReport"/>
    <parameter name="JasperfishSubReportDatasource" isForPrompting="true" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
    <parameter name="JasperOrderInfoDTO" isForPrompting="true" class="com.guohualife.ebiz.bpm.order.dto.OrderInfoDTO"/>
    <parameter name="SUBREPORT_DIR" isForPrompting="true" class="java.lang.String">
        <defaultValueExpression ><![CDATA[".\\"]]></defaultValueExpression>
    </parameter>

    <field name="time" class="java.lang.String"/>

        <background>
            <band height="0"  isSplitAllowed="true" >
            </band>
        </background>
        <title>
            <band height="86"  isSplitAllowed="true" >
                <image  evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="0"
                        width="535"
                        height="86"
                        key="image-1"/>
                    <box></box>
                    <graphicElement stretchType="NoStretch"/>
                    <imageExpression class="java.lang.String"><![CDATA["yiqian-top.jpg"]]></imageExpression>
                </image>
            </band>
        </title>
        <pageHeader>
            <band height="29"  isSplitAllowed="true" >
                <staticText>
                    <reportElement
                        x="166"
                        y="0"
                        width="169"
                        height="29"
                        key="staticText-1"/>
                    <box leftPadding="1" rightPadding="1" topPadding="1" bottomPadding="1"></box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="黑体" size="15" isItalic="false" isUnderline="false"/>
                    </textElement>
                <text><![CDATA[一仟金融]]></text>
                </staticText>
            </band>
        </pageHeader>
        <columnHeader>
            <band height="27"  isSplitAllowed="true" >
                <staticText>
                    <reportElement
                        x="166"
                        y="0"
                        width="169"
                        height="24"
                        key="staticText-2"/>
                    <box leftPadding="1" rightPadding="1" topPadding="1" bottomPadding="1"></box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="11" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[理财交易凭证]]></text>
                </staticText>
            </band>
        </columnHeader>
        <detail>
            <band height="390"  isSplitAllowed="true" >
                <staticText>
                    <reportElement
                        x="15"
                        y="11"
                        width="51"
                        height="22"
                        key="staticText-3"/>
                    <box></box>
                    <textElement textAlignment="Left" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="10" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[凭证来源:]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="176"
                        y="11"
                        width="53"
                        height="22"
                        key="staticText-6"/>
                    <box></box>
                    <textElement textAlignment="Left" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="10" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[项目类型:]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="349"
                        y="11"
                        width="42"
                        height="22"
                        key="staticText-5"/>
                    <box></box>
                    <textElement textAlignment="Left" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="10" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[订单号:]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="391"
                        y="11"
                        width="144"
                        height="22"
                        key="orderNo"/>
                    <box></box>
                    <textElement verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getOrderNo()]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="15"
                        y="43"
                        width="51"
                        height="24"
                        key="staticText-7"/>
                    <box></box>
                    <textElement textAlignment="Left" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="10" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[凭证名称:]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="176"
                        y="43"
                        width="53"
                        height="24"
                        key="staticText-8"/>
                    <box></box>
                    <textElement textAlignment="Left" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="10" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[交易时间:]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="229"
                        y="43"
                        width="110"
                        height="24"
                        key="successDate"/>
                    <box></box>
                    <textElement verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getSuccessDate()]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="349"
                        y="43"
                        width="47"
                        height="24"
                        key="staticText-9"/>
                    <box></box>
                    <textElement textAlignment="Left" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="10" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[交易状态:]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="396"
                        y="43"
                        width="124"
                        height="24"
                        key="orderStatus"/>
                    <box></box>
                    <textElement verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getOrderStatus()]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="15"
                        y="102"
                        width="124"
                        height="30"
                        key="staticText-24"/>
                    <box>                   <pen lineWidth="0.5" lineStyle="Solid"/>
                    <topPen lineWidth="0.5" lineStyle="Solid"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid"/>
                    <bottomPen lineWidth="0.5" lineStyle="Solid"/>
                    <rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="12" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[姓名]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="139"
                        y="102"
                        width="125"
                        height="30"
                        key="staticText-23"/>
                    <box>                   <pen lineWidth="0.5"/>
                    <topPen lineWidth="0.5"/>
                    <leftPen lineWidth="0.5"/>
                    <bottomPen lineWidth="0.5"/>
                    <rightPen lineWidth="0.5"/>
</box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="12" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[项目名称]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="264"
                        y="102"
                        width="125"
                        height="30"
                        key="staticText-22"/>
                    <box>                   <pen lineWidth="0.5"/>
                    <topPen lineWidth="0.5"/>
                    <leftPen lineWidth="0.5"/>
                    <bottomPen lineWidth="0.5"/>
                    <rightPen lineWidth="0.5"/>
</box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="12" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[交易金额]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="389"
                        y="102"
                        width="125"
                        height="30"
                        key="staticText-16"/>
                    <box>                   <pen lineWidth="0.5"/>
                    <topPen lineWidth="0.5"/>
                    <leftPen lineWidth="0.5"/>
                    <bottomPen lineWidth="0.5"/>
                    <rightPen lineWidth="0.5"/>
</box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="12" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[计息时间]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="15"
                        y="132"
                        width="124"
                        height="30"
                        key="realName"/>
                    <box>                   <pen lineWidth="0.5" lineStyle="Solid"/>
                    <topPen lineWidth="0.5" lineStyle="Solid"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid"/>
                    <bottomPen lineWidth="0.5" lineStyle="Solid"/>
                    <rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="12" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getRealName()]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="139"
                        y="132"
                        width="125"
                        height="30"
                        key="productName"/>
                    <box>                   <pen lineWidth="0.5" lineStyle="Solid"/>
                    <topPen lineWidth="0.5" lineStyle="Solid"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid"/>
                    <bottomPen lineWidth="0.5" lineStyle="Solid"/>
                    <rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="12" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getProductName()]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="264"
                        y="132"
                        width="125"
                        height="30"
                        key="investmount"/>
                    <box>                   <pen lineWidth="0.5" lineStyle="Solid"/>
                    <topPen lineWidth="0.5" lineStyle="Solid"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid"/>
                    <bottomPen lineWidth="0.5" lineStyle="Solid"/>
                    <rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="12" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getInvestAmount()]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="389"
                        y="132"
                        width="125"
                        height="30"
                        key="valueDate"/>
                    <box>                   <pen lineWidth="0.5"/>
                    <topPen lineWidth="0.5"/>
                    <leftPen lineWidth="0.5"/>
                    <bottomPen lineWidth="0.5"/>
                    <rightPen lineWidth="0.5"/>
</box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="12" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getValueDate()]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        mode="Transparent"
                        x="15"
                        y="215"
                        width="630"
                        height="15"
                        key="staticText-21"/>
                    <box></box>
                    <textElement verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[...................................................................................................................................................................................................................................................................................]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="15"
                        y="274"
                        width="169"
                        height="17"
                        key="staticText-10"/>
                    <box></box>
                    <textElement verticalAlignment="Bottom">
                        <font pdfFontName="STSong-Light" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[咨询电话:400-1000-948]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="15"
                        y="302"
                        width="188"
                        height="19"
                        key="staticText-11"/>
                    <box></box>
                    <textElement verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[资金担保:保本保息,由新理益集团担保]]></text>
                </staticText>
                <image  evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="429"
                        y="235"
                        width="90"
                        height="90"
                        key="image-2"/>
                    <box></box>
                    <graphicElement stretchType="NoStretch"/>
                    <imageExpression class="java.lang.String"><![CDATA["yiqian-erweima.jpg"]]></imageExpression>
                </image>
                <frame>                 <reportElement
                        mode="Opaque"
                        x="0"
                        y="350"
                        width="535"
                        height="40"
                        backcolor="#B5B5B5"
                        key="frame-1"
                        positionType="FixRelativeToBottom"/>
                    <box></box>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="254"
                        y="6"
                        width="95"
                        height="25"
                        forecolor="#C6090F"
                        key="textField-9"/>
                    <box></box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font pdfFontName="Helvetica" size="11" isItalic="false" isUnderline="true"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA["www.my1000.cn"]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="0"
                        y="6"
                        width="258"
                        height="25"
                        key="staticText-33"/>
                    <box></box>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="11" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[上海一仟互联网金融信息服务有限公司]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        mode="Transparent"
                        x="345"
                        y="6"
                        width="108"
                        height="25"
                        key="staticText-34"/>
                    <box></box>
                    <textElement textAlignment="Left" verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" size="11" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <text><![CDATA[沪ICP备15020040号]]></text>
                </staticText>
                </frame>                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="229"
                        y="11"
                        width="110"
                        height="24"
                        key="voucherDesc"/>
                    <box></box>
                    <textElement verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getVoucherDesc()]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="66"
                        y="43"
                        width="95"
                        height="24"
                        key="voucherName"/>
                    <box></box>
                    <textElement verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getVoucherName()]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="66"
                        y="11"
                        width="95"
                        height="24"
                        key="voucherSource"/>
                    <box></box>
                    <textElement verticalAlignment="Middle">
                        <font pdfFontName="STSong-Light" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{JasperOrderInfoDTO}.getVoucherSource()]]></textFieldExpression>
                </textField>
            </band>
        </detail>
        <columnFooter>
            <band height="0"  isSplitAllowed="true" >
            </band>
        </columnFooter>
        <pageFooter>
            <band height="0"  isSplitAllowed="true" >
            </band>
        </pageFooter>
        <summary>
            <band height="0"  isSplitAllowed="true" >
            </band>
        </summary>
</jasperReport>```

  1. 代码实现:
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.util.HashMap;
import java.util.Map;

import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.export.JRPdfExporter;

/** 
 *  * irport生成pdf
 * 引入的包:(1) jasperreports-3.7.6.jar 依赖的包 
 *                  commons-collections-3.2.1.jar  commons-logging-1.1.1.jar   commons-beanutils-1.8.3.jar  commons-digester-2.1.jar  
 *          (2) itext-2.1.7.jar    iTextAsianCmaps.jar   iTextAsian.jar
 *
 * @version 1.0
 * 创建时间:2016年12月16日 下午7:04:45 
 * 类说明 
 */
public class TestIReport {

    private static String jrxmlSourcePath = "/home/weblogic/test/ireport/a.jrxml";
    private static String jasperFilePath = "/home/weblogic/test/ireport/a.jasper";     
    private static String pdfFilePath = "/home/weblogic/test/ireport/a.pdf";

    public static void main(String[] args) throws Exception {

        //1.将jrxml编译生成a.jasper
        System.out.println(jrxmlSourcePath);  
        JasperCompileManager.compileReportToFile(jrxmlSourcePath, jasperFilePath); 

        /*
         * 将a.jasper-->生成pdf文件
         */
        //2.
        Map<String,Object> parameterMap = new HashMap<String,Object>();
        // parameterMap.put("dto", dto);

        // 3:JasperRunManager生成PDF文件
        JasperPrint jasperPrint = JasperFillManager.fillReport(jasperFilePath, parameterMap, new JREmptyDataSource());
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        JRPdfExporter exporter = new JRPdfExporter();
        exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
        exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, "UTF-8");
        exporter.exportReport();

        byte[] bytes = baos.toByteArray();
        // 4.确定写出文件的位置
        File file = new File(pdfFilePath);
        FileOutputStream fos = new FileOutputStream(file);
        fos.write(bytes);
//      System.out.println("写入成功");
        fos.close();


    }

}
版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

ireport导出excel,html.pdf等格式完整实例

本例报表中的数据是List传入的值,不是通过报表执行查询的数据。本例是基于struts使用的。利用ireport工具导出excel   一、导入irport相关的jar包导入 common-...

ireport导出中文pdf

ireport,jasperreport导出中文pdf 1、设置pdf fontname、isembedded、pdfencoding 注意pdf fontname是STsong-light,其它...

jasperReport5.6.0生成PDF(一)

Jasperreport5.6.0生成PDF   最近项目中需要生成报表,先是看了下itext,觉得还可以,但是如果数据字段多的话,不太灵活。所以后来看了下ireport,觉得还可以...

java用ireport模板生成PDF文件

Map parameters = new HashMap(); //模板中的参数parameters.put("conditions", conditions);parameters.put("t_u...

【iReport+JasperReport】2.在Java工程中利用jasper导出PDF报表

我们上一次成功的利用iReport工具制作了一张报表,并且预览了报表最后的效果,也生成了格式为“jrpxml”、“jrxml”与“jasper”的文件。这次,我们使用jasper提供的java的api...

使用IReport制作并导出PDF文件(一)----文件名默认

1. 使用IReport画出要导出的PDF模板: 2.代码 @RequestMapping(method=RequestMethod.GET,value="/partsChangePDF/{par...

Delphi7高级应用开发随书源码

  • 2003年04月30日 00:00
  • 676KB
  • 下载

iReport中解决Pdf打印中文未能显示问题

报表Pdf时,会出现中文无法显示问题,可以设置相关组件的以下属性。需同时设置,其他字体,可自行尝试。1、Font name :宋体2、pdf Font name is now deprecated:S...
  • tool163
  • tool163
  • 2010年12月22日 16:51
  • 2270

使用ExtJs实现文件下载

文件下载,是不可以直接通过Ext.Ajax.Request来实现的。一般的,可以通过创建一个隐藏的form表单来实现。具体代码以及代码注释如下: if (!Ext.fly('downForm...

ServletContext中getRealPath()读取文件及其他三种读取文件的方式及其区别

ServletContext中getR
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:ireport生成pdf文件
举报原因:
原因补充:

(最多只允许输入30个字)