Jump to content
Changes to the Jaspersoft community edition download ×

NiPo10000

Members
  • Posts

    2
  • Joined

  • Last visited

NiPo10000's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I'm putting together a financial report which as you might guess contains a lot of numbers ($ amounts). Now you can name each textfield (by default: textField-1 .. -2 .. -3 etc. etc.) What I would like to do is have a field that is the sum of a given number of text fields. The only way I can currently see to do that is to assign every DB field to a variable and then every text field takes its display value from that variable, that way I can then have a textfield that derives its display value from $V{amount1} + $V{amount2} + $V{amount3} but this would mean defining a ‘lot’ of variable fields….. Is it possible to have a text field who’s display value if derived from textField-1.value() + textField-2.value() + textField-3.value()?? Any insight into accessing a text field’s value via the Key Element name would be greatly appreciated. Happy Coding NiPo. :silly: Post edited by: NiPo10000, at: 2006/11/04 03:42
  2. I'm not sure whether this is still open... Or whether you guys have found an acceptable work-around. But this is a feature I would very much appreciate... So if anyone has any insight I would appreciate some assistance. Here's what I've discovered so far: 1. "Is Styled Text" does work for a [very] limited set of HTML tags [see:http://jasperreports.sourceforge.net/samples/StyledTextReport.html ] 2. If the text contains ANY HTML tags that aren't supported then the whole HTML file [text] is displayed with the HTML tags visible [i.e. not rendered] 3. Even when you use only the supported HTML tags, tags such as <LI>Point #1</LI> have three addition <BR/> after them resulting in excessive white space. 4. For the fun of it all the HTML tags must be Upper-Case else they are not recognized [see point #2] 5. I have simple HTML [generated by MS Word] hence plugging this little snippet of code into the expression field removes all the unrecognized HTML tags. [Modify as needed.. but there REALLY should be a better way… this is just painful :sick:] Code: /*This removes all the html tags not supported by iReports 1.2.7*/ $F{document}.substring( $F{document}.indexOf( "<body lang=EN-US>" )+17, $F{document}.length() ) .replaceAll( "</html>", ""«»).replaceAll("</body>",""«») .replaceAll($F{document}.substring( $F{document}.indexOf( "class=" )-1, $F{document}.indexOf( ">", $F{document}.indexOf( "class=" ) ) ),""«») .replaceAll("<p class=MsoNormal>",""«»).replaceAll("</p>",""«») .replaceAll("<div>",""«»).replaceAll("</div>",""«») .replaceAll("<b>","<B>"«»).replaceAll("</b>","</B>"«») .replaceAll("<u>","<U>"«»).replaceAll("</u>","</U>"«») .replaceAll("<i>","<I>"«»).replaceAll("</i>","</I>"«») .replaceAll("<li>","<LI>"«»).replaceAll("</li>","</LI>"«») .replaceAll("<OL>",""«»).replaceAll("</OL>",""«») .replaceAll("<span style='color:","<style forecolor='"«»).replaceAll("</span>","</style>"«») .replaceAll(" ",""«»).replaceAll("'","""«») Let me know what you have come up with so far! Happy coding NiPo..
×
×
  • Create New...