Results 1 to 13 of 13
Thread: Jasper Report
- 09-06-2009, 01:08 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 66
- Rep Power
- 0
Jasper Report
Invoice.jrxml
Thats the jrxml that I generated with Report Wizard.Java 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="null" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <queryString language="SQL"> <![CDATA[SELECT * FROM trheaderpemesanan]]> </queryString> <field name="kdPemesanan" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="tanggalPemesanan" class="java.sql.Timestamp"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="totalHarga" class="java.math.BigDecimal"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="totalVolume" class="java.math.BigDecimal"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="diskonPlus" class="java.math.BigDecimal"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="kdPelanggan" class="java.lang.Integer"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="statusPemesanan" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <group name="kdPemesanan"> <groupExpression><![CDATA[$F{kdPemesanan}]]></groupExpression> <groupHeader> <band height="27" splitType="Stretch"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="139" height="27" forecolor="#FFFFFF" backcolor="#000000"/> <textElement> <font size="18"/> </textElement> <text><![CDATA[Kode Invoice]]></text> </staticText> <textField> <reportElement mode="Opaque" x="139" y="0" width="416" height="27" forecolor="#FFFFFF" backcolor="#000000"/> <textElement> <font size="18" isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{kdPemesanan}]]></textFieldExpression> </textField> </band> </groupHeader> <groupFooter> <band height="8" splitType="Stretch"> <line direction="BottomUp"> <reportElement key="line" x="1" y="4" width="554" height="1"/> </line> </band> </groupFooter> </group> <background> <band splitType="Stretch"/> </background> <title> <band height="58" splitType="Stretch"> <line> <reportElement x="0" y="8" width="555" height="1"/> </line> <line> <reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/> </line> <staticText> <reportElement x="65" y="13" width="424" height="35"/> <textElement textAlignment="Center"> <font size="26" isBold="true"/> </textElement> <text><![CDATA[Laporan Pemesanan]]></text> </staticText> </band> </title> <pageHeader> <band splitType="Stretch"/> </pageHeader> <columnHeader> <band splitType="Stretch"/> </columnHeader> <detail> <band height="120" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[Tanggal Pemesanan]]></text> </staticText> <textField> <reportElement x="139" y="0" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{tanggalPemesanan}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="20" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[Total Harga]]></text> </staticText> <textField> <reportElement x="139" y="20" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{totalHarga}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="40" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[Total Volume]]></text> </staticText> <textField> <reportElement x="139" y="40" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{totalVolume}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="60" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[Diskon]]></text> </staticText> <textField> <reportElement x="139" y="60" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{diskonPlus}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="80" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[Kode Pelanggan]]></text> </staticText> <textField> <reportElement x="139" y="80" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{kdPelanggan}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="100" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[Status Pemesanan]]></text> </staticText> <textField> <reportElement x="139" y="100" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{statusPemesanan}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band height="26" splitType="Stretch"> <textField evaluationTime="Report" pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="516" y="6" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <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="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="342" y="6" width="170" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <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 textAlignment="Right"> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="1" y="6" width="209" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <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="10"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band splitType="Stretch"/> </summary> </jasperReport>
It's successfull but, just generate 1 row, no loop at all, how to modif this xml code?
is there any template for report?
thanks
- 09-06-2009, 03:08 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Just use iReport for generating jasper reports.
- 09-07-2009, 04:41 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 66
- Rep Power
- 0
- 09-07-2009, 05:23 AM #4
Google provided: JasperForge: iReport Project Home
- 09-08-2009, 04:38 PM #5
Member
- Join Date
- Aug 2009
- Posts
- 66
- Rep Power
- 0
- 09-08-2009, 04:50 PM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
That's why they come with manuals. If you get a specific error with it then post the error message that you got.
- 09-09-2009, 12:53 AM #7
Member
- Join Date
- Aug 2009
- Posts
- 66
- Rep Power
- 0
it's successfully generate the jrxml, but it's failed to preview.
if I use ireport as a plugin of Netbeans, it's successfully gives a preview, even it can be saved as a pdf, but the template design is standard, and it doesn't loop for some parts.
the code is like above.
- 09-09-2009, 09:17 AM #8
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
How did it fail to preview? What error message did you get?
The looping depends on what you put in the detail band and is all explained the iReport manual.
- 09-10-2009, 01:01 PM #9
Member
- Join Date
- Aug 2009
- Posts
- 66
- Rep Power
- 0
- 09-10-2009, 01:12 PM #10
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
- 09-11-2009, 03:01 AM #11
Member
- Join Date
- Aug 2009
- Posts
- 66
- Rep Power
- 0
This is the Result, it loops successfully, but I just want to loop for the detail (the blues one), the black one I want it on header, and the red one, I want it on footer.
watch the color of this file :
Free File Hosting Made Simple - MediaFire
Actually, This is the best preview for the report.
As Example, I want to create Report for Invoice #0000001, then, it gives me report for all items, and their details.
The header of the report is about the invoice detail, and the footer is about the shipment detail.
this is the screen shot of my .jar

Thanks palz, for your help until today :)Last edited by sysout; 09-11-2009 at 04:13 AM.
- 09-16-2009, 03:35 PM #12
Member
- Join Date
- Aug 2009
- Posts
- 66
- Rep Power
- 0
anyone has successfully used JasperReport combined with Java? So it can send parameters from Java to the report.
Please, I really need your hands :(
- 09-16-2009, 03:37 PM #13
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Similar Threads
-
jasper report
By vidhyaprabu in forum New To JavaReplies: 6Last Post: 11-12-2009, 03:31 AM -
jasper report in struts
By saru_2785@rediff.com in forum Advanced JavaReplies: 2Last Post: 03-31-2009, 11:30 AM -
JSP and Jasper Report in Netbeans 6.1
By ShatireAzam in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 11-08-2008, 09:43 AM -
Cannot compile or run jasper report!!!!!!!
By neo3matrix in forum XMLReplies: 0Last Post: 09-23-2008, 02:10 PM -
Jasper report + JPQL
By tarat in forum Advanced JavaReplies: 2Last Post: 08-01-2008, 06:47 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks