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

deklotz

Members
  • Posts

    20
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by deklotz

  1. Just in case this turns out useful for someone else.... Turns out that "nl_nl" is wrong. I am using an Applet with plain old java objects being serialized to the server. In order to set the Locale for the session (back on the server) I am setting accept-language. At first I used Locale.getDefault().toString() which created the string "nl_nl". This is wrong. I must use Locale.getDefault().getLanguage () instead. Now I end up with just "nl". Now when I'm down inside the server, tomcat (for free) takes the accept-language if it is present and modifies the request object to have the correct Locale object. This I then later use as a parameter for Jasper and now the msg() expression work.
  2. Aye I am wondering if I need to hit the books again... I just verified that inside of the class JREvaluator the method getMessageFormat is indeed receiving the Locale "nl_nl". Code: /** * */ private MessageFormat getMessageFormat(String pattern) { MessageFormat messageFormat = new MessageFormat(""«»); messageFormat.setLocale((Locale)locale.getValue()); messageFormat.applyPattern(pattern); return messageFormat; } The pattern is "{0,number,###.##}" and locale "nl_nl" yet the resulting number is 47.09! Am I misunderstanding how the pattern is used? How do I specify a pattern that will use , for a . in the right locale? Thanks again for taking the time to respond.
  3. Hello. If you have the bandwidth to comment on this post, I would appreciate it. Thanks! A problem using REPORT_LOCALE Post edited by: deklotz, at: 2007/02/05 14:49
  4. Greetings. Another Locale question. What I want: 1) Numbers formated to the passed Locale parameter 2) Percents placed according to the passed Locale parameter. What I have: 1) Client applet, server tomcat jdk 1.5, Jasper 1.3.0 2) client Locale serialized to server 3) (as an example) Jasper REPORT_LOCALE set to "nl_nl" 4) Local server JVM set to default US Locale 5) Jasper invoked on server to create PDF 6) JRXML file with several Text Field Expressions such as: Double with pattern #,##0.00 % String with the Expression : msg("{0,number,percent}", new Double [] { $V{CL11_V_Z} }) What I get: 1) It appears that I get the default US Locale. 2) Numbers have US commas and decimal. 3) Percents are not correct. I hope someone can point me to what I'm doing wrong. Do I need a resource bundle even though I'm not using that aspect of it? Do I need to have a different Expression in order to have the passed REPORT_LOCALE used? Is the "nl_nl" incorrect? I've noticed that sometimes the denmark Locale is marked nl_NL. Thank you in advance for any ideas. -Dennis Here is a section from the jrxml file: Code: <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Opaque" x="257" y="2" width="26" height="12" forecolor="#000000" backcolor="#FFFFFF" key="textField-37"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Center" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Arial" pdfFontName="Helvetica" size="6" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[msg("{0,number,###.##}", new Double[] { $F{COLUMN_7}})]]></textFieldExpression> </textField> and another section: Code:[code] <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Opaque" x="414" y="16" width="45" height="18" forecolor="#0033CC" backcolor="#FFFFFF" key="textField-49"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Center" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Arial" pdfFontName="Helvetica" size="6" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[(($V{CL11_V_Z}.doubleValue() <= 0.0) ? " " : (($V{CL11_V_Z}.doubleValue() < 0.0001) ? "<" + (msg("{0,number,percent}", new Double[] { new Double(0.0001) })) : (msg("{0,number,percent}", new Double [] { $V{CL11_V_Z} }))) )]]></textFieldExpression> </textField> Post edited by: deklotz, at: 2007/02/05 14:44 Post edited by: deklotz, at: 2007/02/05 14:45 Post edited by: deklotz, at: 2007/02/05 17:43
  5. lucianc wrote: The msg() method has been fixed to use the report locale in JasperReports 1.2.8. You could update the JR version in your application and see whether msg() works as expected. HTH, Lucian Lucian, Thank you for the information! I'm unpacking the latest version now. As soon as I posted the question a little voice inside said that I should have peaked at the latest source. Thanks again.
  6. Greetings, I apologize for posting this twice but I realized the first post was potentially in the wrong forum. I've recently started down the localization path and I've discovered that while Jasper Reports does use the passed locale parameter in several places, it doesn't appear to be used whenever I use a "msg (...)" statement in a jrxml text field expression. After looking into source code, the shorthand statement translates into a call to MessageFormat.format () which, the javadoc states, uses getLocale(). Doesn't that use the JVM locale at that point? Can anyone help clear up my confusion? Is this perhaps fixed? I was looking at 1.2.7 source code. Thanks in advance for any help you can provide.
  7. swood wrote: The default behavior is to use the locale of your browser. We are testing out a completely internationalized version of JI now, which will give you more control over locale and time zone setting. Sherman JasperSoft Sherman, I've recently started down the localization path myself and I've discovered that while Jasper Reports does use the passed locale parameter in several places, it doesn't look like it will be used whenever I have a "msg (...)" statement in a jrxml text field expression. That shorthand statement translates into a call to MessageFormat.format () which, the javadoc states, uses getLocale(). Doesn't that use the JVM locale at that point? Can you help clear up my confusion? Is this perhaps fixed in the version you mention? Thanks in advance for any help you can provide. -Dennis
  8. deklotz

    artf1579

    Teodor, Thank you! If I could send you and your team a bottle of wine (or beer :)) I would do so! Perhaps I will look for a donation link... Regards, Post edited by: deklotz, at: 2006/10/13 20:55
  9. deklotz

    artf1579

    Hello. Just bumping the thread. Thanks for your time Teodor. Post edited by: deklotz, at: 2006/10/13 20:55
  10. deklotz

    artf1579

    That is great news Teodor! Thank you. I'll keep checking for any news. Post edited by: deklotz, at: 2006/10/13 20:55
  11. deklotz

    artf1579

    I have updated the Bug report with more information. I was able to reproduce this problem using the provided demo code. I had to make a slight change so that the applet code has a relative size of 100% for both width and height. With that change, resizing a mozilla based web browser causes a deadlock when running the embedded applet. Post edited by: deklotz, at: 2006/10/13 20:55
  12. deklotz

    artf1579

    Greetings. May I get comments on http://jasperforge.org/sf/go/artf1579?nav=1 Thank you! Post edited by: deklotz, at: 2006/10/13 20:54
  13. // duplicate Post edited by: deklotz, at: 2006/09/11 19:52
  14. Hello. Does anyone have a problem with the following changes to JRViewer? Code: $ diff -c src/net/sf/jasperreports/view/JRViewer.java ../jasperreports-1.2.5-project/src/net/sf/jasperreports/view/JRVi ewer.java *** src/net/sf/jasperreports/view/JRViewer.java Fri Sep 8 17:23:51 2006 --- ../jasperreports-1.2.5-project/src/net/sf/jasperreports/view/JRViewer.java Mon Jul 3 14:49:08 2006 *************** *** 65,71 **** import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JViewport; - import javax.swing.SwingUtilities; import javax.swing.filechooser.FileFilter; import net.sf.jasperreports.engine.JRException; --- 65,70 ---- *************** *** 347,361 **** { this.resourceBundle = resBundle; } - - try - { - exporter = new JRGraphics2DExporter(); - } - catch (Exception e) - { - e.printStackTrace (); - } } --- 346,351 ---- *************** *** 1590,1595 **** --- 1580,1586 ---- { try { + JRGraphics2DExporter exporter = new JRGraphics2DExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRGraphics2DExporterParameter.GRAPHICS_2D, grx); exporter.setParameter(JRExporterParameter.PAGE_INDEX, new Integer(pageIndex)); *************** *** 1620,1634 **** public void paintComponent(Graphics g) { ! synchronized (viewer) ! { ! viewer.paintPage((Graphics2D)g.create()); ! } } } ! ! private JRGraphics2DExporter exporter ; ! // Variables declaration - do not modify//GEN-BEGIN:variables protected javax.swing.JToggleButton btnActualSize; --- 1611,1620 ---- public void paintComponent(Graphics g) { ! viewer.paintPage((Graphics2D)g.create()); } } ! // Variables declaration - do not modify//GEN-BEGIN:variables protected javax.swing.JToggleButton btnActualSize; I did this against 1.2.5, if there is interest I would be happy to do this against 1.2.6. Thanks. -Dennis [file name=PatchContents size=723]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/jasper1.txt[/file] Post edited by: deklotz, at: 2006/09/11 19:57
  15. Greetings, First I wish to say that I have been using the Jasper Report library for almost two years and I have offered my support by buying two copies of the Ultimate Guide. Excellent work in both area if I may say so. Just recently I have run into a snag with the JRViewer class. I ended up using the class as it stands within my applet classes and for a long time, I have had no problems with it. This even with the warning from the developer that the class is offered as an example. The bug I've come across is related to the following: 1) Using mozilla/firefox engine 2) Windows XP SP2, Java 1.5 latest 3) Applet using Jasper 1.2.5 (I also tried the latest too) 4) Run the browser with applet and everything looks and is running fine. 5) Resize the browser main window and after a couple of passes within the JRViewer's inner classes paintComponent (The extended JLabel for the main report body) - the browser and java lockup! The lockup only occurs within the firefox/mozilla engine. Internet Explorer works just fine. After a lot of hair pulling I've figured out that the JRViewer inner class is needlessly creating a JRExporter object every time the inner classes paintComponent is called. I've moved the creation of the object outside to one of the main JRViewer class intialization methods and so far so good. My quesiton to the world :) is whether there are any reasons not to do this and if anyone has run across this problem before? Any and all advice is greatly appreciated. -Dennis Klotz
  16. This is a real problem. I had to edit the build.xml to include about three or four missing class files into the applet jar before it would work. Not a big deal and I'm sorry I don't have the list handy here at home.
×
×
  • Create New...