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

Posts posted by Pedja

  1. 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()

  2. 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.
  3. ( $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.

  4. 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}:" ")

  5. 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

  6. 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.
  7. 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.
  8. 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);
  9. 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.

  10. 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

  11. 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

  12. 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

  13. 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() : "-")
×
×
  • Create New...