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

donbowden

Members
  • Posts

    6
  • 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 donbowden

  1. I am trying to create a month variable from a date field.  I then want to use the month variable to group by month.  I have created a variable called "month" and assigned the formula:

    $F{TRAFFICDATE1}.getMonth()

    But this returns an error of "cannot cast from int to string".

    Please advise if this approach will work for grouping a report based on what month a paricular date field is associated.  Thanks.

     

     

  2. Hi Giulio,

    Thank you for your response.  I attempted your line of code and received the following error.  First let's review the actual code used with the actual field names:

    new Integer( (int) ( ($F{MORTAPPLYDATE}.getTime() - $F{CONTRACTDATE}.getTime()) / (1000*60*60*24) )

    Next is the following error as reported in the "Report Problems Window":

    Errors compiling N:JasperSoft iReportReportsProspectMasterList9.jasper!
    Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@830ed5  net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, calculator_ProspectMasterList_1239763427882_470676: 284: unexpected token: } @ line 284, column 9. 1 error      at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:92)     at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:192)     at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)     at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:135)     at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:538)     at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)     at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
    Compilation running time: 391!
     

    Thank you again for your asistance.  BTW, I have purchased and read your book and it provided much assistance.

    Regards,

    Don

     

  3. Hi everyone!

    I need to have a conditional statement that finds the number of days between two dates.  If the second date is null, then  it should calculate the the number of days between the first date and the current date, but if the second date is not null then return the actual number of days between the two dates.  From what I can determine, I know I need to manipulate the data types but I have not been able to find the right syntax to make it work. 

    ($F(DateType2) != null) ? New Date() - $F(DateType1)  : $F(DateType2) - $F(DateType1)

    Much thanks for any help in resolving this issue.

    Don

     

    Code:
    ($F(DateType2) != null) ? New Date() - $F(DateType1)  : $F(DateType2) - $F(DateType1)
×
×
  • Create New...