B4J Question java.util.Date error

atiaust

Active Member
Licensed User
Longtime User
Hi All,

I posted this question with the library but I think that may have been the wrong place so reposted here.

I have this library working with Next Reports Designer and Engine v9.1.

Does anyone know how to pass a 'date' variable to to the engine. Strings & numbers are fine but I get an error with dates. I have a report with 'start_date' and 'end_date'. The report works in the designer.

"ro.nextreports.engine.ReportRunnerException: ro.nextreports.engine.ReportRunnerException: java.lang.ClassCastException: javafx.scene.control.DatePicker cannot be cast to java.util.Date"

Thanks
 

atiaust

Active Member
Licensed User
Longtime User
Thanks Erel,

I now get this error.

java.lang.NumberFormatException: For input string: "(DatePicker) DatePicker@59afc4[styleClass=combo-box-base date-picker]"

Any clues?

Thanks
 
Upvote 0

atiaust

Active Member
Licensed User
Longtime User
Erel,

The problem was a code error on my behalf. I wasn't getting the ticks value from the Datepicker.

Should have been:

B4X:
Dim t As Long
'
    t = dpDateFrom.DateTicks
    inputlist.add("start_date")
    inputlist.add(TicksToDate(t))
'   
    t = dpDateTo.DateTicks
    inputlist.add("end_date")
    inputlist.add(TicksToDate(t))

This now allows me to select a Next Reports report by date range and I am very impressed how it works.

Thanks
 
Upvote 0
Top