locked
Crystal Reports with VS2008 date filter RRS feed

  • Question

  • I am using VS2008 Pro and Crystal Reports Basic. I'm displaying a report from a dataset, grouped by date. Everything works "perfectly".

    The problem is that the Group Date field shows differently. For ex. May 28, 2012 in the database, shows up on the report as May 27, 2012. This occurs for every date in the database.

    Using the same data in a gridview on a form produces the correct dates. The only difference is that I use a SQL query (as I do for the form), as then add the data to another dataset as follows

    Dim sc = from tms in db.TmsSchedules Where tms.schDate >= firstDate and tms.schDate <= lastDate etc....

    dim r As DataRow

    for each dr In sc

     r = t.NewRow()

    r("schDate") = dr.schDate

    etc...

    Next

    Using this exact data from sc, I fill a datagridview

    me.DataGridView1.DataSource = sc ' This works perfectly and the date shows up as "May 28, 2012" not "May 27, 2012" as the report shows.

    • Moved by Jie Bao Monday, June 4, 2012 8:31 AM (From:Visual Basic IDE)
    Sunday, June 3, 2012 2:47 PM

Answers

  • Actually, I found a work around. I deleted the Group name in the report and added the schDate field in the same position. For some reason, adding the field gives the correct date, while adding a group field based on the date doesn't
    • Proposed as answer by Mark Liu-lxf Monday, June 4, 2012 4:50 AM
    • Marked as answer by Mr. Wharty Tuesday, June 12, 2012 1:37 AM
    Sunday, June 3, 2012 2:55 PM

All replies

  • Actually, I found a work around. I deleted the Group name in the report and added the schDate field in the same position. For some reason, adding the field gives the correct date, while adding a group field based on the date doesn't
    • Proposed as answer by Mark Liu-lxf Monday, June 4, 2012 4:50 AM
    • Marked as answer by Mr. Wharty Tuesday, June 12, 2012 1:37 AM
    Sunday, June 3, 2012 2:55 PM
  • Hi apalix,

    Welcome to the MSDN forum.

    I’m glad that you found a workaround to your issue. But I’m afraid that your topic about Crystal Report is out of scope there. If you have any issue about Crystal Report, please connect to the official website of Crystal Report in this link: http://www.sdn.sap.com/irj/scn/advancedsearch?query=crystal+report .

    Sorry for any incontinences and have a nice day.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    Monday, June 4, 2012 4:50 AM