Jump to content
We've recently updated our Privacy Statement, available here ×

myphuong

Members
  • Posts

    4
  • Joined

  • Last visited

myphuong's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I'm Vietnamese, I use Ireport to export rtf file with large of records, it's more than 1500 records, When export rtf file, the textfields & statictexts looked like textbox in file, so file very large because it contained many textboxs. I cannot open this file. Can anybody help me resolve this prolem, or how to replace textboxs by another like table when export rtf? Please help me, thanks very much!! My report is designed like follow: Code:<?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="Employee_Report2" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.331000000000001"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="3"/> <style name="Title" forecolor="#FFFFFF" fontName="Times New Roman" fontSize="50" isBold="false" pdfFontName="Times-Bold"/> <style name="SubTitle" forecolor="#CCCCCC" fontName="Times New Roman" fontSize="18" isBold="false" pdfFontName="Times-Roman"/> <style name="Column header" forecolor="#666666" fontName="Times New Roman" fontSize="14" isBold="true" pdfFontName="Times-Roman"/> <style name="Detail" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman"/> <style name="Row" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman"> <conditionalStyle> <conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression> <style mode="Opaque" backcolor="#F0EFEF"/> </conditionalStyle> </style> <parameter name="logopath" class="java.lang.String"/> <parameter name="companyname" class="java.lang.String"/> <parameter name="companyaddress" class="java.lang.String"/> <parameter name="companyphone" class="java.lang.String"/> <parameter name="companywebsite" class="java.lang.String"/> <parameter name="companyemail" class="java.lang.String"/> <parameter name="reportname" class="java.lang.String"/> <parameter name="currentdate" class="java.util.Date"/> <parameter name="language" class="java.lang.String"/> <queryString language="hql"> <![CDATA[from Employee]]> </queryString> <field name="name" class="java.lang.String"/> <field name="birthday" class="java.util.Date"/> <field name="gender" class="java.lang.Boolean"/> <field name="code" class="java.lang.String"/> <field name="jobtitle" class="java.lang.String"/> <field name="status" class="java.lang.Short"/> <field name="type" class="java.lang.String"/> <field name="department" class="java.lang.String"/> <variable name="stt" class="java.lang.Integer" resetType="Column" calculation="Sum"> <variableExpression><![CDATA[new Integer(1)]]></variableExpression> <initialValueExpression><![CDATA[new Integer(1)]]></initialValueExpression> </variable> <background> <band splitType="Stretch"/> </background> <title> <band height="158" splitType="Stretch"> <textField> <reportElement x="100" y="70" width="702" height="30"/> <box leftPadding="5"/> <textElement> <font fontName="Arial" size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Website : " + $P{companywebsite}]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="50" width="702" height="20"/> <box leftPadding="5"/> <textElement> <font fontName="Arial" size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{language}.equals( "vi" )?("Äiện thoại : "+$P{companyphone}+" Email : " + $P{companyemail}):("Phone : "+$P{companyphone}+" Email : " + $P{companyemail})]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="30" width="702" height="20"/> <box leftPadding="5"/> <textElement> <font fontName="Arial" size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{companyaddress}]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="0" width="702" height="30"/> <box leftPadding="5"/> <textElement> <font fontName="Arial" size="22"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{companyname}]]></textFieldExpression> </textField> <image onErrorType="Blank" hyperlinkType="LocalPage"> <reportElement x="0" y="0" width="100" height="100"/> <imageExpression class="java.lang.String"><![CDATA[$P{logopath}]]></imageExpression> </image> <textField> <reportElement x="0" y="100" width="802" height="58"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Arial" size="22"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{reportname}]]></textFieldExpression> </textField> </band> </title> <columnHeader> <band height="19"> <frame> <reportElement x="0" y="0" width="802" height="19" isRemoveLineWhenBlank="true"/> <box> <pen lineWidth="0.5"/> <topPen lineWidth="0.25"/> <leftPen lineWidth="0.25"/> <bottomPen lineWidth="0.25"/> <rightPen lineWidth="0.25"/> </box> <staticText> <reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="0" y="0" width="30" height="19" forecolor="#000000" backcolor="#999999"/> <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 fontName="Arial" size="10" isBold="true" pdfFontName="Courier-Bold" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <text><![CDATA[sTT]]></text> </staticText> <staticText> <reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="30" y="0" width="70" height="19" forecolor="#000000" backcolor="#999999"/> <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 fontName="Arial" size="10" isBold="true" pdfFontName="Courier-Bold" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <text><![CDATA[MNV]]></text> </staticText> <staticText> <reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="100" y="0" width="120" height="19" forecolor="#000000" backcolor="#999999"/> <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 fontName="Arial" size="10" isBold="true" pdfFontName="Courier-Bold" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <text><![CDATA[Nhân viên]]></text> </staticText> <staticText> <reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="536" y="0" width="108" height="19" forecolor="#000000" backcolor="#999999"/> <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 fontName="Arial" size="10" isBold="true" pdfFontName="Courier-Bold" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <text><![CDATA[Chức danh]]></text> </staticText> <staticText> <reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="644" y="0" width="48" height="19" forecolor="#000000" backcolor="#999999"/> <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 fontName="Arial" size="10" isBold="true" pdfFontName="Courier-Bold" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <text><![CDATA[Giá»›i tính]]></text> </staticText> <staticText> <reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="220" y="0" width="68" height="19" forecolor="#000000" backcolor="#999999"/> <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 fontName="Arial" size="10" isBold="true" pdfFontName="Courier-Bold" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <text><![CDATA[Ngà y sinh]]></text> </staticText> <staticText> <reportElement stretchType="RelativeToBandHeight" x="692" y="0" width="110" height="19"/> <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 fontName="Arial" isBold="true" pdfEncoding="Identity-H"/> </textElement> <text><![CDATA[Trạng thái]]></text> </staticText> <staticText> <reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="288" y="0" width="90" height="19" forecolor="#000000" backcolor="#999999"/> <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 fontName="Arial" size="10" isBold="true" pdfFontName="Courier-Bold" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <text><![CDATA[Loại nhân viên]]></text> </staticText> <staticText> <reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="378" y="0" width="158" height="19" forecolor="#000000" backcolor="#999999"/> <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 fontName="Arial" size="10" isBold="true" pdfFontName="Courier-Bold" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <text><![CDATA[P.Chấm công]]></text> </staticText> </frame> </band> </columnHeader> <detail> <band height="19" splitType="Immediate"> <frame> <reportElement x="0" y="0" width="802" height="19" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true"/> <box> <pen lineWidth="0.5"/> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.25"/> <bottomPen lineWidth="0.25"/> <rightPen lineWidth="0.25"/> </box> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="30" height="19" isPrintWhenDetailOverflows="true"/> <box leftPadding="3"> <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 fontName="Arial" pdfFontName="Courier" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="100" y="0" width="120" height="19" isPrintWhenDetailOverflows="true"/> <box leftPadding="3"> <pen lineWidth="0.5"/> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement verticalAlignment="Middle"> <font fontName="Arial" pdfFontName="Courier" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="644" y="0" width="48" height="19" isPrintWhenDetailOverflows="true"/> <box leftPadding="0"> <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 fontName="Arial" pdfFontName="Courier" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[($F{gender}.equals( true )?"Nam":"Nữ")]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="30" y="0" width="70" height="19" isPrintWhenDetailOverflows="true"/> <box leftPadding="3"> <pen lineWidth="0.5"/> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{code}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="536" y="0" width="108" height="19" isPrintWhenDetailOverflows="true"/> <box leftPadding="3"> <pen lineWidth="0.5"/> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement verticalAlignment="Middle"> <font fontName="Arial" pdfFontName="Courier" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{jobtitle}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern=" dd/MM/yyyy" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="220" y="0" width="68" height="19" isPrintWhenDetailOverflows="true"/> <box leftPadding="0"> <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 fontName="Arial" pdfFontName="Courier" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[$F{birthday}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="692" y="0" width="110" height="19" isPrintWhenDetailOverflows="true"/> <box leftPadding="3"> <pen lineWidth="0.5"/> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement verticalAlignment="Middle"> <font fontName="Arial" pdfFontName="Courier" pdfEncoding="Identity-H"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[( $F{status}==0 ? "Äang là m việc" : ($F{status}==1 ? "Äình chỉ" : ($F{status}==2 ? "Nghỉ việc" : ($F{status}==3 ? "Nghỉ hÆ°u" : ($F{status}==4 ? "Chuyển công tác" :("Khác")))) ))]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="288" y="0" width="90" height="19" isPrintWhenDetailOverflows="true"/> <box leftPadding="3"> <pen lineWidth="0.5"/> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement verticalAlignment="Middle"> <font fontName="Arial" pdfFontName="Courier" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[($F{type}==null || $F{type}.equals( "" ))?"Hợp đồng":($F{type}.equals("0")?"Công chức":($F{type}.equals("2")?"Viên chức":($F{type})))]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="378" y="0" width="158" height="19" isPrintWhenDetailOverflows="true"/> <box leftPadding="3"> <pen lineWidth="0.5"/> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement verticalAlignment="Middle"> <font fontName="Arial" pdfFontName="Courier" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{department}]]></textFieldExpression> </textField> </frame> </band> </detail> <pageFooter> <band height="20" splitType="Prevent"> <frame> <reportElement mode="Opaque" x="0" y="0" width="802" height="20" forecolor="#D0B48E" backcolor="#000000"/> <textField> <reportElement style="Column header" x="682" y="0" width="120" height="20" forecolor="#FFFFFF"/> <textElement textAlignment="Right" verticalAlignment="Middle"> <font size="10" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Trang "+$V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField pattern=""> <reportElement style="Column header" x="0" y="0" width="197" height="20" forecolor="#FFFFFF"/> <textElement verticalAlignment="Middle"> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Thứ "+($P{currentdate}.getDay()+1) + " ngà y " + ($P{currentdate}.getDate()) + " tháng " + ($P{currentdate}.getMonth()+1)+ " năm "+ ($P{currentdate}.getYear()+1900)]]></textFieldExpression> </textField> </frame> </band> </pageFooter> <summary> <band splitType="Stretch"/> </summary></jasperReport>
  2. I have a same problem with you, but reverse with you. I want to format double value with pattern: commas for decimal separator, and dot for thousand separator. Can you or anyone help me? thanks very much! Note: i want it still is double value, not change to String, :) Post Edited by myphuong at 09/27/2011 10:36
  3. hi, everyone. I'm a new member. I have two problems when export excel in ireport - with double value, i use formatter to format it into String with my pattern (#.###,00), export pdf is OK. But when export excel, it recognized this cell as text. I want it to be converted into number when export into excel automatically. - after convert to number, i want to set formula SUM for range values in one column. How do I set it to export both excel and pdf? Hope everyone to help me! Note: I use code java to export pdf, excel, rtf. I'm not good at English. If I have any mistake, please ignore them, thank you!
  4. hi, everyone. I'm a new member. I have two problems when export excel in ireport - with double value, i use formatter to format it into String with my pattern (#.###,00), export pdf is OK. But when export excel, it recognized this cell as text. I want it to be converted into number when export into excel automatically. - after convert to number, i want to set formula SUM for range values in one column. How do I set it to export both excel and pdf? Hope everyone to help me! Note: I use code java to export pdf, excel, rtf. I'm not good at English. If I have any mistake, please ignore them, thank you!
×
×
  • Create New...