Reputation: 225
I have a dataset I have created and sorted, I then bind it to a Crystal Report:
Dim cmd As New SqlCommand("Driverperformance", con.connect)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@Ecode", SqlDbType.NVarChar, 50, ParameterDirection.Input).Value = Ecode
cmd.Parameters.Add("@startdate", SqlDbType.DateTime, 50, ParameterDirection.Input).Value= fromd
cmd.Parameters.Add("@enddate", SqlDbType.DateTime, 50, ParameterDirection.Input).Value= endd
da.SelectCommand = cmd
da.Fill(ds)
Dim rpt As New Driverperformanc
rpt.SetDataSource(ds.Tables(0))
crptdriverprfrmnc.ReportSource = rpt
While executing this store procedure am getting out put sorted by date..i mean like this:
Ecode Date cntEcount cntDelcod
E003 2013-05-05 4 3
E003 2013-05-27 0 4
E003 2013-06-01 1 2
but the crystal reports losing my sorting. In crystal report sorting by cntEcount.i
getting crystal report like this:
Ecode Date cntEcount cntDelcod
E003 2013-05-27 0 4
E003 2013-06-01 1 2
E003 2013-05-05 4 3
So I try to add date field to Record Sort Expert..but still am getting report sorted by cntEcount.
I am working on a vb.net windows application..so where do I have to make a change to allow sorting by date?
Image from other question:
my " Record Sort Expert" is like this:
Upvotes: 0
Views: 1538
Reputation: 41
• Right click on group and go to "Group Expert" → • Under "Group by" find "Options" button → • In the "Common" tab there, change to "In original order."
Upvotes: 2
Reputation: 3850
As you have groups on CntEcode
and Ename
Crystal will always sort by these fields first, sadly there is no easy way around this.
If you can describe what you are using the groups for there may be a work around that doesn't use groups.
Upvotes: 0