TopN/Sort Group

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2007
Posts: 2
Reputation: rianjyothi is an unknown quantity at this point 
Solved Threads: 0
rianjyothi rianjyothi is offline Offline
Newbie Poster

TopN/Sort Group

 
0
  #1
Apr 10th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 1
Reputation: GrandVizier is an unknown quantity at this point 
Solved Threads: 0
GrandVizier GrandVizier is offline Offline
Newbie Poster

Re: TopN/Sort Group

 
0
  #2
Apr 19th, 2007
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.
  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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC