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

data is not displaying properly in pdf when input string contains '%' character


gudavallibhavani1999

Recommended Posts

when input string contains "%", the string after this % is getting printed in new line on PDF which is created using jasper soft studio

example: 

input String : AAAAAAAAAAAAAAAAAAAAA%BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

output:

AAAAAAAAAAAAAAAAAAAAA%

BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

case 2: when the string between two "%" characters able to fit in same line (based on width of textfield) then the string is coming in same line otherwise printing on new line

input String : AAAAAAAAAAAAAAAAAAAAA%BBBBBBBBBBBBBB%CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

output:

AAAAAAAAAAAAAAAAAAAAA%BBBBBBBBBBBBBB%

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

tried using different pdf encodings and by changing properties of text field but still having the issue 

could someone please help me to resolve this issue..

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic


Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.

Link to comment
Share on other sites

Hi, 

Could you please confirm your Jaspersoft version?

I tried with a sample scenario where I added the input control text as 

Test1%TestConditionTrueforThisCaseAndThisScenario and this is getting printed in a single line.

Tried with test1%bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbBB is also getting printed in a single line. 

However, I see that if we increase the characters, then it's behaving as you mentioned.

Could you please elaborate on the scenario which you are trying to achieve? 

 

Thanks

Link to comment
Share on other sites

Hi,

i am using TIBCO Jaspersoft studio 6.12.0-Visual Designer for JasperReports 6.12.1 version.

Expected Output:

should get the whole input string on PDF without getting split when we have %  ! ; . " () [] {} these characters in input string, we need to display the input string properly on pdf text field though we have those special characters in input string by continuing on same line without going to new line (means the string should utilize the current line width of text field).

Final Target: we should display the string on pdf text field as given in input by filling from left to right and by considering the width of field.

 

 

 

Link to comment
Share on other sites

Hi,

What we see here is standard Java word break/wrap policy and not the result of something we implemented ourselves.

It is not clear what exactly you are looking. Are you looking for changing the list of characters that can trigger word breaks, or would you rather have any word cut in the middle if it does not fit? Are you looking to change the way words break/wrap, or are you looking for disabling word break/wrap altogether and simply cut text wherever the text element width occurs?

Thank you,

Teodor

Link to comment
Share on other sites

Hi,

I am looking for disabling string break when we have %  ! ; . " () [] {} these characters

input: AAAAAAAAAAAAAA%BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB;CCCCCCCCCCCC

getting output on pdf like below: string breaks when we have % and ;(consider below box as text field in japser soft and pdf)

AAAAAAAAAAAAAA%

BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB;

CCCCCCCCCCCC

Expected: string should not break even when we have % and ; on string

AAAAAAAAAAAAAA%BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

BBBBBBBBBBBBBBB;CCCCCCCCCCCC

 

Link to comment
Share on other sites

Hi,

I am looking for disabling string break when we have %  ! ; . " () [] {} these characters

input: AAAAAAAAAAAAAA%BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB;CCCCCCCCCCCC

getting output on pdf like below: string breaks when we have % and ;(consider below box as text field in japser soft and pdf)

AAAAAAAAAAAAAA%

BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB;

CCCCCCCCCCCC

Expected: string should not break even when we have % and ; on string

AAAAAAAAAAAAAA%BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

BBBBBBBBBBBBBBB;CCCCCCCCCCCC

Link to comment
Share on other sites

You did not clarify it for me. So let me ask it differently:

If there is a space character somewhere, would you want the word after it to be moved onto next row or should it be cut in the middle?

For example, if there is a space between the BBBs and the CCCs, should it look like this:

AAAAAAA%BBBBBB CCCCCCC

CCCCC

Or should it look like this:

AAAAAAA%BBBBBB

CCCCCCCCCCCC

So I understand that special characters cause unwanted breaks for you, but should we prevent all word breaks, including the classical white spaces and tabs? No word wrap anymore, just break anywhere element width dictates?

Link to comment
Share on other sites

Hi,

if there is a space between the BBBs and the CCCs, the output should look like this

AAAAAAA%BBBBBB

CCCCCCCCCCCC

should we prevent all word breaks, including the classical white spaces and tabs?

answer for the above question is no, incase of whitespace and tabs it should move to next line when there is only limited space for the word after the whitespace.

example:

string : It was found that 64% respondents should come back saying yes.

expected output:

It was found that 64%

respondents should come back saying yes.

not like:

It was found that 64% respo

ndents should come back saying yes.

please help me to resolve this issue as soon as possible.

Thank you.

Link to comment
Share on other sites

Hi,

Achieving this behaviour means customising the way word break policy occurs in Java/AWT.

It is not trivial and this can only be done in the context of a request for enhancement, as it is not considered a bug.

It would have been easier if word wrap would have been disabled altogether, but what we are talking about here is custom word break policy.

It is not even clear how such custom word break policy would be configured. Would it be about establishing a list of characters that should or should not cause word breaks?

Definetly not trivial.

Thank you,

Teodor

Link to comment
Share on other sites

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...