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

IReport:text box to escape charater like ''-''


nithyanand11

Recommended Posts

In ireport, if am try to display a string like "1234567890-abcdefgh" in text box with width - "15",  but its just showing

"1234567890-     " remaining "abcdefgh"  was skipped and displayed in second line.. but i need to display like

"1234567890-abcd" , just to display the string as much space available. please help which escaping method will be suitable to

handle this scenario.

 

 

 

 

 

 

 

 

-thanks in advance

 

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

thank you, but still am having some issues. i gave "JRPrintText.getFullText($F{HOSTNAME})" in Text Fieldexpression.. i got

Error:


Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@136d4 net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. The method getFullText() in the type JRPrintText is not applicable for the arguments (String)                
        value = (java.lang.String)(JRPrintText.getFullText(((java.lang.String)field_MYTEXT.getValue()))); //$JR_EXPR_ID=28$

 

 

i saw many functions but it will very mush helpful to me if i got some examples or any sample implementation

 

thanks

Link to comment
Share on other sites

Why would you use that expression for the text field?  If you want to use the property that I pointed to, all you have to do is to set the property at report or element level as below.

Regards,

Lucian

Code:
<jasperReport ...><property name="net.sf.jasperreports.text.truncate.at.char" value="true"/>...<textField>  <reportElement>    <property name="net.sf.jasperreports.text.truncate.at.char" value="true"/>  </reportElement>...
Link to comment
Share on other sites

  • 1 month later...

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