Not showing the correct date .

Posted by: ravi.jasti on 15 September 2019, 2:10 pm EST

  • Posted 15 September 2019, 2:10 pm EST

    Hi ,
    when i try to write my resultset to excel using grapecity the issue is coming .
    i.e there is a date column in which some values are not showing properly like day saving is getting applied so we are seeing 1hr or 12 hr change of value in excel sheet. but value is coming correctly from resultset. grapecity is changing the value.
    we found issue in timeZone "MET"..

    Please need a solution ASAP
  • Replied 15 September 2019, 7:37 pm EST


    Can you please share your resultset which you are binding with GcExcel? Or please share the code you used to create the resultset . Along with that please share your GcExcel JAVA version. We will then investigate your issue further.

    And I possible please send us a small sample replicating the issue, this would help us in resolving your issue at the earliest.

  • Replied 16 September 2019, 12:27 pm EST


    here is a simulation code for your reference .zip file there is a snapshot "Data-in-Database-Snapshot.png" , make a copy of it as same in your database and we are using Oracle. you can change it to your needed.

    Note :
    for this "please share the code you used to create the resultset ".
    resultset cannot be shared but sharing a snapshot of it

    Requirements :
    Use JDK 1.8
    Below two jars are required

    Everything else, read the code
  • Replied 16 September 2019, 12:26 pm EST

    FYI :
    Its working perfectly for other outputs like csv, template based outputs etc but mismatch is coming only for excel using grapecity.

    please refer above to simulate the issue..
  • Replied 16 September 2019, 10:09 pm EST


    We are investigating your issue with the concerned team and we will get back to you soon on the same. In the meantime we would request you to please test your case with the latest build version 2.2.5 and let us know your observations.

  • Replied 17 September 2019, 4:06 am EST

    we have already checked on 2.2.5 version , but still the issue is same..

    as per your document
    i try to keep LocalDateTime

    below error is coming
    java.lang.IllegalArgumentException: Unsupported data type: class java.time.LocalDateTime. Currently, we only support data of type: Primitive Type, Number, String, Boolean, CalcError, Date, Calendar, Character.

    let me know if your concerned team wants more information, we can have a conference call . as this is issue need to be solved as soon as possible...
  • Replied 18 September 2019, 10:13 pm EST


    We are able to replicate the issue and hence we are escalating the same to the concerned team for the fix.

    Tracking id for your issue is #DOCXLS-1532

    We will update you as soon as we hear anything from our concerned team.

  • Marked as Answer

    Replied 25 September 2019, 9:08 pm EST


    According to our developers, you must add reference of "gcexcel-extension" in your sample given here:-

    And if you don't want DST to play a role then use LocalDateTime and if you want DST to play a role then use Date. And that's the correct way of handling timezone and DST in java not only in GcExcel.

    Hope it clarifies.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels