943,918 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 2306
  • VB.NET RSS
Apr 10th, 2007
0

TopN/Sort Group

Expand Post »
I needed code for dynamically selecting the TopN/Sort Group Expert in crystal report. I am using VB.net and SQL. My report has its data coming from a stored procedure written.
This will be of great help as i needed to give the option for my top sales report.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rianjyothi is offline Offline
2 posts
since Apr 2007
Apr 19th, 2007
0

Re: TopN/Sort Group

I've got the same problem here. I've been looking into doing the same thing and haven't found any solutuions. I've got 3 different fields that I want the user to be able to sort by. I also would like them to have the option of entering a parameter to limit the results displayed. Of course this can all be easily done during design time with 'TopN/Sort Group Expert', but how do you sort a Sum field during runtime.

I've tried using sort fields but I can't get beyond an "Invalid field name" error.
VB Syntax (Toggle Plain Text)
  1. Dim crSortField As SortField
  2. Dim fieldDef As DatabaseFieldDefinition
  3. For Each crSortField In crReportDocument.DataDefinition.SortFields
  4. If crSortField.Field.Name.ToString = strField Then
  5. fieldDef = crReportDocument.Database.Tables(0).Fields(crSortField.Field.Name.ToString) 'where error occurs
  6. crSortField = crReportDocument.DataDefinition.SortFields(0)
  7. crSortField.Field = fieldDef
  8. crSortField.SortDirection = SortDirection.DescendingOrder
  9. Else
  10. 'used for debuging
  11. Label1.Text += " " & crSortField.Field.Name.ToString & ", "
  12. End If
  13. Next
Reputation Points: 10
Solved Threads: 0
Newbie Poster
GrandVizier is offline Offline
1 posts
since Apr 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Truncated Emails
Next Thread in VB.NET Forum Timeline: Listview vb.net





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC