Jump to content
Changes to the Jaspersoft community edition download ×

Pedja

Members
  • Posts

    92
  • Joined

  • Last visited

Pedja's Achievements

Enthusiast

Enthusiast (6/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. You can put it directly in Text Field Expression, or you can make a variable, it depends on what you need.
  2. What are the types of the num1, num2 and num3? If it is BigDecimal, you can set your field to java.lang.Float, and set the expression to ($F{num1}.floatValue() + $F{num2}.floatValue())/$F{num3}.floatValue()
  3. Did you compile the changed subreport before testing the main report again? You need to recompile it, just saving it isn't enough, since the .jasper file is what the main report looks at. However, if you run the subreport it is automatically compiled. Also, check the location of the .jasper file (check time modified on the file to make sure it is the one) and make sure that the path in the main report points to that location.
  4. Maybe this won't help, but when you compare Strings you should use equals() or equalsIgnoreCase() methods $P{DeviceTypeID}.equals("1")
  5. ( $P{ElcA}== null ? new Integer(0) : $V{ElcA}.valueOf( $P{ElcA} ) ) Is this suppose to calculate the Integer value of $P{ElcA} if it is != null? Can you try ( $P{ElcA}== null ? new Integer(0) : Integer.valueOf( $P{ElcA} ) ) If that doesn't help, try to create new Map object instead of cleaning the one you have, I don't think it has anything to do with that but you can give it a try.
  6. Put all three fields in one text field, and concatenate their expressions ($F{NAME_SALUTATION_DESCRIPTION}!= null ? $F{NAME_SALUTATION_DESCRIPTION} : "") + " " + ($F{V_PERSON_FIRST_NAME} != null ? $F{V_PERSON_FIRST_NAME} : "") + " " + ($F{V_PERSON_LAST_NAME} != null ? $F{V_PERSON_LAST_NAME} : "") + " " + ($F{NAME_SUFFIX_DESCRIPTION} != null ? $F{NAME_SUFFIX_DESCRIPTION}:" ")
  7. "System" keeps the last value set for the variable in memory, nothing is calculated. It's useful for these kind of cases. Glad to be helpful :)
  8. What happens if you set the Calculation Type of the variable to System? From the application, use "new JREmptyDataSource()" instead of your connection object when you generate the report. Post edited by: Pedja, at: 2008/04/17 09:40
  9. You can't, because parameters are allowed only in WHERE clause, I can't think of an easy workaround right now. Maybe you could use subreport with a query for the other table and set the "Print when Expression" to something based on your parameter.
  10. You have created a connection to your XML data source, then create a new report and use that connection for it. I never worked with XML data source, but I'm sure there are some tutorials and the forum is very helpful, try searching it for some hints.
  11. Initial value of a variable is the value it has when it initializes, if you have a variable that is Integer and you don't specify initial value it will be null, you can set it to new Integer(0). Variable expression is what the variable "listens to", if you set it to $F{field} and the Calculation Type is Sum, then it will sum the values of $F{field}. Experiment with it, it all depends on the use case.
  12. If you want to test if a parameter is null, use $P{Demo}==null, because you can't call a method on a null object.
  13. "Report query" is active only when you create a report or open an existing one, the screenshot shows that you don't have any open reports in the file list.
  14. Put this before you call JasperFillManager.fillReport() Code: HashMap paramMap = new HashMap(); paramMap.put("WHERE_PARAM", idName); and put the paramMap in fillReport() method Code:[code] JasperPrint jp = JasperFillManager.fillReport(JASPER_REPORT_FOLDER + JASPER_FILENAME + ".jasper", paramMap, conn);
  15. You have to define a parameter (right click somewhere in Document structure panel -> Add -> Parameter), and then you can use it in your query.
×
×
  • Create New...