Results 1 to 13 of 13
- 12-01-2008, 11:19 AM #1
Member
- Join Date
- Nov 2008
- Posts
- 85
- Rep Power
- 0
- 12-01-2008, 12:31 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Can you explain more clearly. What's the field are you talking about?
- 12-02-2008, 10:28 AM #3
Member
- Join Date
- Nov 2008
- Posts
- 85
- Rep Power
- 0
Re:
Hi,
In the below eg,How to trim the TOTALAMOUNT(Field) Value...
<?xml version="1.0"?>
<jasperReport
name="SimpleReport"
columnCount="1"
printOrder="Horizontal"
orientation="Portrait"
pageWidth="800"
pageHeight="842"
columnWidth="535"
columnSpacing="0"
leftMargin="30"
rightMargin="30"
topMargin="20"
bottomMargin="20"
whenNoDataType="NoPages"
isTitleNewPage="false"
isSummaryNewPage="false">
<field name="TOTALCNT" class="java.lang.String"/>
<field name="TOTALAMOUNT" class="java.lang.String"/>
<title>
<band height="50" isSplitAllowed="true">
<staticText>
<reportElement
mode="Transparent"
x="200"
y="6"
width="345"
height="39"
forecolor="#0000CC"
backcolor="#FFFFFF"
key="staticText-1"
stretchType="NoStretch"
positionType="FixRelativeToTop"
isPrintRepeatedValues="true"
isRemoveLineWhenBlank="false"
isPrintInFirstWholeBand="false"
isPrintWhenDetailOverflows="false" />
<box
topBorder="None"
topBorderColor="#000000"
leftBorder="None"
leftBorderColor="#000000"
rightBorder="None"
rightBorderColor="#000000"
bottomBorder="None"
bottomBorderColor="#000000" />
<textElement
textAlignment="Center"
verticalAlignment="Top"
rotation="None"
lineSpacing="Single">
<font
fontName="Arial"
pdfFontName="Helvetica-Bold"
size="10"
isBold="true"
isItalic="false"
isUnderline="false"
isPdfEmbedded="false"
pdfEncoding="Cp1252"
isStrikeThrough="false" />
</textElement>
<text><![CDATA[REPORT]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="18">
<staticText>
<reportElement
mode="Transparent"
x="0"
y="0"
width="50"
height="18"
forecolor="#0000CC"
backcolor="#FFFFFF"
key="staticText-2"
stretchType="NoStretch"
positionType="FixRelativeToTop"
isPrintRepeatedValues="true"
isRemoveLineWhenBlank="false"
isPrintInFirstWholeBand="false"
isPrintWhenDetailOverflows="false" />
<box
topBorder="None"
topBorderColor="#000000"
leftBorder="None"
leftBorderColor="#000000"
rightBorder="None"
rightBorderColor="#000000"
bottomBorder="None"
bottomBorderColor="#000000" />
<textElement
textAlignment="Left"
verticalAlignment="Top"
rotation="None"
lineSpacing="Single">
<font
fontName="Arial"
pdfFontName="Helvetica-Bold"
size="9"
isBold="true"
isItalic="false"
isUnderline="false"
isPdfEmbedded="false"
pdfEncoding="Cp1252"
isStrikeThrough="false" />
</textElement>
<text><![CDATA[TOTALCNT]]></text>
</staticText>
<staticText>
<reportElement
mode="Transparent"
x="70"
y="0"
width="100"
height="18"
forecolor="#0000CC"
backcolor="#FFFFFF"
key="staticText-2"
stretchType="NoStretch"
positionType="FixRelativeToTop"
isPrintRepeatedValues="true"
isRemoveLineWhenBlank="false"
isPrintInFirstWholeBand="false"
isPrintWhenDetailOverflows="false" />
<box
topBorder="None"
topBorderColor="#000000"
leftBorder="None"
leftBorderColor="#000000"
rightBorder="None"
rightBorderColor="#000000"
bottomBorder="None"
bottomBorderColor="#000000" />
<textElement
textAlignment="Left"
verticalAlignment="Top"
rotation="None"
lineSpacing="Single">
<font
fontName="Arial"
pdfFontName="Helvetica-Bold"
size="9"
isBold="true"
isItalic="false"
isUnderline="false"
isPdfEmbedded="false"
pdfEncoding="Cp1252"
isStrikeThrough="false" />
</textElement>
<text><![CDATA[TOTALAMOUNT]]></text>
</staticText>
</band>
</pageHeader>
<detail>
<band height="20">
<textField
isStretchWithOverflow="false"
pattern=""
isBlankWhenNull="false"
evaluationTime="Now"
hyperlinkType="None"
hyperlinkTarget="Self"
bookmarkLevel="0">
<reportElement
mode="Transparent"
x="0"
y="0"
width="50"
height="18"
forecolor="#000000"
backcolor="#FFFFFF"
key="textField"
stretchType="NoStretch"
positionType="FixRelativeToTop"
isPrintRepeatedValues="true"
isRemoveLineWhenBlank="false"
isPrintInFirstWholeBand="false"
isPrintWhenDetailOverflows="false" />
<box
topBorder="None"
topBorderColor="#000000"
leftBorder="None"
leftBorderColor="#000000"
rightBorder="None"
rightBorderColor="#000000"
bottomBorder="None"
bottomBorderColor="#000000" />
<textElement
textAlignment="Left"
verticalAlignment="Top"
rotation="None"
lineSpacing="Single">
<font
fontName="Arial"
pdfFontName="Helvetica"
size="8"
isBold="false"
isItalic="false"
isUnderline="false"
isPdfEmbedded="false"
pdfEncoding="Cp1252"
isStrikeThrough="false" />
</textElement>
<textFieldExpression class="java.lang.String">
<![CDATA[$F{TOTALCNT}]]>
</textFieldExpression>
</textField>
<textField
isStretchWithOverflow="false"
pattern=""
isBlankWhenNull="false"
evaluationTime="Now"
hyperlinkType="None"
hyperlinkTarget="Self"
bookmarkLevel="0">
<reportElement
mode="Transparent"
x="70"
y="0"
width="100"
height="18"
forecolor="#000000"
backcolor="#FFFFFF"
key="textField"
stretchType="NoStretch"
positionType="FixRelativeToTop"
isPrintRepeatedValues="true"
isRemoveLineWhenBlank="false"
isPrintInFirstWholeBand="false"
isPrintWhenDetailOverflows="false" />
<box
topBorder="None"
topBorderColor="#000000"
leftBorder="None"
leftBorderColor="#000000"
rightBorder="None"
rightBorderColor="#000000"
bottomBorder="None"
bottomBorderColor="#000000" />
<textElement
textAlignment="Left"
verticalAlignment="Top"
rotation="None"
lineSpacing="Single">
<font
fontName="Arial"
pdfFontName="Helvetica"
size="8"
isBold="false"
isItalic="false"
isUnderline="false"
isPdfEmbedded="false"
pdfEncoding="Cp1252"
isStrikeThrough="false" />
</textElement>
<textFieldExpression class="java.lang.String">
<![CDATA[$F{TOTALAMOUNT}]]>
</textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="9" isSplitAllowed="true" />
</columnFooter>
<pageFooter>
<band height="40" isSplitAllowed="true">
<line direction="TopDown">
<reportElement x="0" y="10" width="800" height="1" positionType="FixRelativeToTop" stretchType="NoStretch" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" />
<graphicElement />
</line>
<textField isStretchWithOverflow="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" bookmarkLevel="0">
<reportElement x="200" y="20" width="80" height="15" positionType="FixRelativeToTop" stretchType="NoStretch" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" />
<textElement textAlignment="Right" />
<textFieldExpression class="java.lang.String">
<![CDATA[ "Page " + String.valueOf($V{PAGE_NUMBER}) + " of"]]>
</textFieldExpression>
</textField>
<textField evaluationTime="Report" isStretchWithOverflow="false" hyperlinkType="None" hyperlinkTarget="Self" bookmarkLevel="0">
<reportElement x="280" y="20" width="75" height="15" positionType="FixRelativeToTop" stretchType="NoStretch" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" />
<textElement />
<textFieldExpression class="java.lang.String">
<![CDATA[ " " + String.valueOf($V{PAGE_NUMBER})
]]>
</textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>
- 12-02-2008, 12:58 PM #4
Member
- Join Date
- Jun 2008
- Posts
- 14
- Rep Power
- 0
I am not sure what do you mean. But, I used trim function at database query (SQL iReport). I think you can Cast number value to String value, then used trim function. Hope help
- 12-03-2008, 06:58 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
First of all try to explain your question more clearly. You have post a large code here, I don't think anyone knows what you need to have there.
- 12-03-2008, 10:57 AM #6
Member
- Join Date
- Nov 2008
- Posts
- 85
- Rep Power
- 0
Re
Hi Ergana,
How to trim the String value .This string is get it from query and used in jrxml.How to trim the string value by using jrxml code.
- 12-03-2008, 01:11 PM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I don't know what jrxml code do. What trim done on String in Java is, remove all starting and ending spaces.
- 12-03-2008, 01:24 PM #8
What do you mean by trim?
Deepa... to you, what does trim mean?
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 12-04-2008, 05:49 AM #9
Member
- Join Date
- Nov 2008
- Posts
- 85
- Rep Power
- 0
Re:
I want to remove the spaces.I mean,
For an eg:
This is done by java code.But what i'm required means,i get the amt value from database and after that i will trim that amt value by using jrxml code.String amt=" 12,000.00";
System.out.println("amt:"+amt.trim())
Output:
amt:12,000.
- 12-04-2008, 06:01 AM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Do you want to remove spaces at the start of string or decimal values, as your output says.
- 12-04-2008, 06:17 AM #11
Member
- Join Date
- Nov 2008
- Posts
- 85
- Rep Power
- 0
Re:
To remove spaces at the start of string value.But this is done by jrxml code.
- 12-04-2008, 07:11 AM #12
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Since String API able to do this easily, I don't know why are you suing another API?
- 01-03-2009, 08:27 AM #13
Member
- Join Date
- Dec 2008
- Posts
- 3
- Rep Power
- 0
How to give conditions in jrxml ? (Jasper Report)
Hi all,
i want to give condition in my jrxml file.
For example, i am fetching one fields "currentStatus", Integer data type
if current status equal to 9, it should display "Submitted"
if 10, "placed"
if 11, blah blah.....etc...
How to do that?
Thanks in advance.
- Gnaniyar Zubair
Similar Threads
-
Error loading object from file : C:\Date.jrxml Jass Report
By cecily in forum JDBCReplies: 2Last Post: 12-03-2008, 11:14 AM -
How to trim text in viewer
By diva_garg in forum SWT / JFaceReplies: 4Last Post: 08-26-2008, 02:03 PM -
I need help fixing my code.. or non code?
By MrHuggykins in forum New To JavaReplies: 1Last Post: 03-19-2008, 10:12 PM -
String trim
By Java Tip in forum Java TipReplies: 0Last Post: 01-21-2008, 04:35 PM -
Generating Code Automatically Using Custom code Template In Eclipse
By JavaForums in forum EclipseReplies: 1Last Post: 04-26-2007, 03:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks