Unnecessary space Between words

Hello,

In the design of my report, some unnecessary space are captured automatically in textField as well as StaticText.


Below text,
String value  = "THis is checklist, THis is checklist for make ready action. It's include ActivityType and location for trigger point. This checklist for only Project admin role. The checklist name is very long.THis is checklist, THis is checklist for make ready action. It's include ActivityType and location for trigger point. This checklist for only Project admin role. The checklist name is very long."

Above in String value i added only one space between all words. Also In pdf, On first line the string value captured as per above text but in second line they automatically consume extra space in between words.
below the code 
    textField = new JRDesignTextField();
        textField.setX(41);
        textField.setY(21);
        textField.setWidth(259);
        textField.setHeight(25);
        textField.setFontSize(10f);
        textField.setForecolor(Color.decode("#093B5C"));
        textField.setHorizontalTextAlign(HorizontalTextAlignEnum.JUSTIFIED);
        jrExpression = new JRDesignExpression();
        jrExpression.setText("$P{checkListName}");
        textField.setExpression(jrExpression);
        band.addElement(textField);
 and i also added  image for output of pdf.

Can anyone know why this happen?
Bhavin Panchal

Attachments: 
bhavin.panchal's picture
Joined: Dec 16 2021 - 11:15pm
Last seen: 2 months 1 week ago

2 Answers:

May be that is because of Jusified which tries equalise left and right side

kenil.m's picture
Joined: Mar 22 2023 - 10:25pm
Last seen: 1 week 5 days ago

Now i removed the Jusified from textField but still i got this space related issue.
String value = "THis is checklist, THis is checklist for makeready action.It's include ActivityType and location for triggerpoint.This checklist for only Project admin role.The checklist name is very long.THis is checklist,THis is checklist for makeready action.It's include ActivityType and location for trigger point.This checklist for only Project admin role.The check list name is very long. fudhu shfuhsi sduhf ushfduf hudshf duh udfd dsudhu"
Below code,
      textField = new JRDesignTextField();
        textField.setX(36);
        textField.setY(99);
        textField.setWidth(350);
        textField.setHeight(25);
        textField.setFontSize(9f);
        textField.setForecolor(Color.decode("#0E588A"));
        jrExpression = new JRDesignExpression();
        jrExpression.setText("$P{checkListName}");
        textField.setExpression(jrExpression);
        band.addElement(textField);
and below i attached pdf output.

Attachments: 
AttachmentSize
Image icon pdfoutput2.png60.49 KB
bhavin.panchal's picture
Joined: Dec 16 2021 - 11:15pm
Last seen: 2 months 1 week ago
Feedback