Jump to content
Changes to the Jaspersoft community edition download ×

how to add space before string

2004 IR Help

Recommended Posts

By: anil kumar - bondalapati

how to add space before string

2005-06-15 08:51

i have a data like this







****** here   represents space******

to dispaly data in this form, is there any solution for me. I know the number of spaces that i require at the starting of the row. i tried to keep space before string but that gets trimmed by the browser and printing all the rows at the same level. So please help me with this how i can do.









By: Horoxxx - horoxxx

RE: how to add space before string

2005-06-15 09:13

try to use groups, group by expression and also new variable with spaces





By: C-Box - c-box

RE: how to add space before string

2005-06-15 23:34

Well I got something similiar to work just when using styledText instead of simple string....


so you could simply try something like this:






****** here   represents space****** :-)


So I do have an "t" within my text an I replace it with 8 spaces before I generate the StyledText.

Note that you check the "isStyledText" attribute of the textfield when using this kind of text.










By: Sony George - sony3002

RE: how to add space before string

2005-07-01 22:54



i want to put a space before and after of my fields

so i created a parameter a

<parameter name="space_1" class="java.lang.String" isForPrompting="false">

<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>



and made my textfield styled text


<textField isBlankWhenNull="true">

<reportElement positionType="Float" x="0" y="0" width="92" height="20"/>

<box topBorder="None" leftBorder="1Point" bottomBorder="1Point" rightBorder="None"/>

<textElement verticalAlignment="Middle" isStyledText="true">

<font fontName="Arial" size="10"/>


<textFieldExpression class="java.lang.String"><![CDATA[$P{space_1}+$F{BOOK_NO}]]></textFieldExpression>



but what i get on the html page is

" &nbsp; "

ie report changes the & symbol to html & and

place it


i also created a variable

<variable name="space" class="java.lang.String">

<initialValueExpression><![CDATA[" "]]></initialValueExpression>



and also the same result i got


any solution for this problem ????



Sony George

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...