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

Pedja

Members
  • Posts

    92
  • 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 Pedja

  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.
  16. Maybe the crosstab element is simply too small, try to stretch it as much as possible (according to the screen shots you attached, you may want to enlarge the whole report).
  17. Put "new JREmptyDatasource()" instead of your connection object, and in your report design you have to define all the parameters that you want to use. Then, in your code, you can put something like parameterMap.put("MY_PARAM", paramValue); and use the $P{MY_PARAM} to get the value from the map.
  18. Hi, I have a query that returns top 40 results based on some criteria, and they are sorted by percentage, something like this: 30% 18% 12% 12% 5% . . . . The pie chart shows all 40, and it is very unreadable. Is it possible to set the chart to show only results >10% (or top 5 results), and to group all the other results to one pie slice ("Other", for example) with the sum of all of their values as the slice value? I could do this in my query, but I'm interested if this is possible with JFreeChart? Thanks, Pedja
  19. racerzack, you said that you are new to Java, and the problems you run into are mainly Java related. For example, Integer is a class and int is a simple type, if you want to compare them you need to call $F{AMT}.intValue() method that returns int value of Integer. Feel free to post any other problems you encounter! Pedja
  20. You can create one parameter (for example $P{DISPLAY_MODE} set it to BigDecimal type), read all the fields from the db, and selectively display them based on the parameter value. Let's say that the parameter value 0 is for offline, 1 for online and 2 for both; in the fields you want to print if the offline is selected, in "Print when expression" put ($P{DISPLAY_MODE}.intValue()==0 || $P{DISPLAY_MODE}.intValue()==2), and in the fields you want to print if the online is selected put ($P{DISPLAY_MODE}.intValue()==1 || $P{DISPLAY_MODE}.intValue()==2). I hope this helps! Pedja
  21. The error says that $F{billable} is type Integer, and you can't compare it with 1 which is a simple type int. Try ($F{billable}.intValue()== 1) ? "Y" : "N"
  22. You can do this by setting the query to select empId, empName from emp where $P!{WHERE_PARAM} and then putting what you want in WHERE_PARAM.
  23. View -> Bands -> noData set the height to whatever you need, the default is 0px.
  24. Put ":" instead of "," in your expression, and then check the field type. This will work for string, for some other type you have to put that type instead of "-", or leave the field as String and setting the expression as ($V{SUM_RECEIPT_AMOUNT_STAT_CURRENCY_1} != null ? $V{SUM_RECEIPT_AMOUNT_STAT_CURRENCY_1}.toString() : "-")
  25. Set the "Position type" property on all the elements below the one that stretches to "Float".
×
×
  • Create New...