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

augarte

Members
  • Posts

    270
  • 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 augarte

  1. Hi, I really don't know what could be happening there, but what is strange for me is that the names of your database fields are between double quotes and it seems there is a space betwen the table name and the fields. Anyway, the problem could be that you need to scape double quotes. I know it works from iReport and your query is defined there, but basically the jrxml file is an xml so maybe you need to do something like this: imovimientos. "movemppaic" AS imovimiento_movemppacic,... Check this out: http://www.devx.com/tips/Tip/14068 Hope this helps. Regards, Aitor
  2. Hi, I had the same issue and didn't find a way to get the document as text. I know it's a mess up to have all in textboxes but I think there is no way to change it. Regards.
  3. Hi, Not sure how could yo do this, maybe this could work: (($F{Field1}.intValue () ==new Integer(1).intValue() && Integer.parseInt($F{Field2})!=new Integer(0).intValue()) ? Boolean.TRUE : Boolean.FALSE) In this case I assume that Field1 is BigDecimal and Field2 is string type. Hope this helps. Regards.
  4. Don't worry :-) I guess PARTTRACKINGID is 'Java.lang.Integer' cause 'int' is not in the available types. So in this case I think this should work: (($F{PARTTRACKINGID}.intValue() == 5)? $F{TRACKINGTEXTINFO}: "") If you want to compare it with TRACKINGTEXTTAGID you should change to: (($F{PARTTRACKINGID].intValue() == $F{TRACKINGTEXTTAGID}.intValue()) ? $F{TRACKINGTEXTINFO} : "") Note that the field your are editing the expression has to be 'Java.lang.String' type. Hope this helps. Regards.
  5. And which is the type of your fields? This is very important when writing expressions
  6. Hi, I think you don't need getValue function. To compare the fields both have to be the same type. If these are integer type try setting this: (($F{PARTTRACKINGID} == $F{TRACKINGTEXTTAGID})? $F{TRACKINGTEXTINFO}: "") Otherwise, if they are string type you have to do a small modification: (($F{PARTTRACKINGID}.equals($F{TRACKINGTEXTTAGID}))? $F{TRACKINGTEXTINFO}: "") Hope this helps. Regards. Post Edited by augarte at 01/27/2012 14:56
  7. Hi, Make sure that your fields are Integer type becasue otherwise will not work (($F{Field1}==1 && $F{Field2}!=0) ? Boolean.TRUE : Boolean.FALSE) Hope this helps, Regards.
  8. Hi Svenn, Thanks for your answer. I found the following example and was able to export my JasperPrint to a Scalable Vector Graphics (svg) file. That's a good improvement but want to have it in a different format (jpg, bmp...). I've tried using the same code to export to png, jpg and bmp formats but I'm not able to open this files. Here is the code: import net.sf.jasperreports.engine.util.JRLoader; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.export.JRGraphics2DExporter; import net.sf.jasperreports.engine.export.JRGraphics2DExporterParameter; import net.sf.jasperreports.engine.JRExporterParameter; import org.apache.batik.dom.GenericDOMImplementation; import org.apache.batik.svggen.SVGGraphics2D; import java.io.File; import java.io.FileWriter; import org.w3c.dom.*; public class Test{ public static void main (String [] args) { try { JasperPrint jp = (JasperPrint)JRLoader.loadObject ("MyReport.jasper"); DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation(); Document document = domImpl.createDocument(null, "png", null); SVGGraphics2D grx = new SVGGraphics2D(document); JRGraphics2DExporter exporter = new JRGraphics2DExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp); exporter.setParameter(JRGraphics2DExporterParameter.GRAPHICS_2D, grx); exporter.setParameter(JRExporterParameter.PAGE_INDEX, new Integer(0)); exporter.exportReport(); grx.stream(new FileWriter(new File("MyReport.png")), true); } catch (Exception e) { System.out.println (e); } } } Do you know how can I achieve what I want? Thanks again! Regards.
  9. Hi, Is it posible to export a jasper object to an image (bmp, jpg...)?. Until now I've been able to export it to different formats (pdf, xls, doc...) but finding in Google about an image exporter didn't get any succesfull result. Does anybody know how could I do it? Thanks in advance. Regards.
  10. And which is the value of your Collection? I mean, I undestand all the values in your collection are strings but can you apply toString() function to a Collection? Maybe you have to take the elements of your collection one by one and construct a string in order to use it in your query. I don't really understand how can you pass a Collection type object to a String type. Regards.
  11. Hi, For using parameteres in your queries you need to reference them in a different way. Try putting this in your query: SELECT parameter from table Where parameter1 IN ($P!{collection_input}.toString()) This should work. Hope this helps. Regards.
  12. Hi, you can define a TextField, setting the following as the textfield expresssion: "Your current employer, | " + $F{employerName} + "|, will contact you soon." This way it does not matter the width of the employerName filed, it will be fit between the two pieces of text. Hope this helps. Regards, Aitor
  13. Hi, Don't know if this solves your problem but in the report Properties there is an option "Ignore Pagination". Regards.
  14. Hi, I guess you are using xPath expressions. The expression you have put in your field returns the node, but if you want to get the value of this node, I think you should put the following: /sisa:Root/sisa:header/sisa:arrangementname/text() I have used the following xPath evaluator to load xml files and evaluate different expressions, it is really helpfull: http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm Hope this helps. Regards.
  15. And have you tried setting an evaluation time different to "Now" ?
  16. Hello, You can edit the Print When Expression of your field and put the following: (($V{PAGE_NUMBER} == 1) ? Boolean.TRUE : Boolean.FALSE) Not sure if it is PAGE_NUMBER or PAGE_COUNT the variable that stores the number of pages. Hope this helps. Regards.
  17. Not sure if this will work, but try putting the following in the Print When Expression of the header band: (($V{PAGE_NUMBER} == 1) ? Boolean.TRUE : Boolean.FALSE) Hope this helps. Regards.
  18. Hi, Nice to know it worked ;-) I'll try to solve your doubts: 1) I think this should work. If you check the javadoc there is a fillReport function that only has these two parameteres: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JasperFillManager.html 2) I'm not sure about this point. If you check the javadoc what the put method needs is the following: put(Object key, Object value) Try to do it as you have it and write here again if you have any problem Good luck Regards, Aitor
  19. Hi, If I have understood well you need to pass a parameter from your java code and use it in the iReport query. You can create parameters from iReport and pass them in a Map when calling JasperFillManager.fillReport. Then, to use these parameters in your query you need to write them as follows: $P!{ParamName} For example in one of my reports I use parameters in the query: SELECT * FROM PrtAls WHERE PrtAls like '%$P!{Prt}%' AND EndDat >= '$P!{IniDatFmt}' AND EndDat <= '$P!{EndDatFmt}' If I didn't understand well your problem you can try to explain it in Spanish. I guess it will be easier for you ;-) Hope this helps. Regards
  20. Hi, Not sure if you need to create a variable. I think it depends on the data type of your PO field. If it is a string you just can edit the textfield expression ans put it at follows: ((!F{PO}.equals("2")) ? "Approved" : !F{PO}) If PO field is an integer, you should create a string type variable and put the expression as follows: ((!F{PO} == 2) ? "Approved" : ""+!F{PO}) Hope this helps. Regards.
  21. Ok, this is the query to retrieve the data you have to add to the report, but what about the range? Where do you get this data from? I know you told me that it is defined in customtimestamp.info but how do you get it? In another query? I do not see the relation between the query and how do you want to set the date range.
  22. Still don't understand very well... when you run your report you need to say somehow the values that define this data range. You say you get them from customtimestamp.info column but how to retrieve this information? I guess you need 2 values to define the range. How do you get these values? You only have two values or need to execute some query to retrieve this values? Try to explain step by step and post a piece of code because otherwise will be difficult to help you. Regards.
  23. Hi again, nice to know it worked. Could you be more explicit? I understand you want to filter your data in order to take only the values that are inside a range of dates, but where do you get the values that define the range from? An easy way for doing that could be using parameters. You can modify your query to take only the values that are between two parameters, lets say IniDat and EndDat. Is this what you want to do? If so, you just have to define the two parameters and then add the following where sentence in your query: WHERE Dat >= '$P!{IniDat}' AND EndDat <= '$P!{EndDat}' Hope this helps. Regards.
  24. I thougth the problem was with the current date, but anyway you should be able to set a pattern for your field. Check the "Field class" of the field you are retrieving from the database and then define a pattern for it. In my case de Field class is java.sql.Timestamp but maybe you need it to change it to java.util.Date. Just check it and let us know if you have any problem.
  25. Hi, I guess you have added the date from "Tools-> Current Date" inside the report elements. Then, in the field properties, you have to select a pattern that includes only the date and not the time (. Tell me if I didn't understand your problem well. Hope this helps. Regards, Aitor
×
×
  • Create New...