on 04-26-2010 10:54 PM
I have a report that I allow the sorting order to be defined by the End User. Multiple choices can be selected for each sorted column (I allow 3 different sorts on same report). When I am receiving an error when running the report and can not find either the correct approach or a method to achieve the sorting I need. Here is a quick code sample (field name modified for readability, but same value):
crReport.DataDefinition.SortFields(0).Field = crReport.Database.Tables(My.Settings.EmployeeTable).Fields("")
crReport.DataDefinition.SortFields(0).SortDirection = SortDirection.AscendingOrder
crReport.DataDefinition.SortFields(1).Field = crReport.Database.Tables(My.Settings.EmployeeTable).Fields("")
crReport.DataDefinition.SortFields(1).SortDirection = SortDirection.AscendingOrder
Thrown exception:
"Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))"
The exception is thrown on the first line.
I am using Crystal Reports 2008 with Visual Studio 2005.
Any help would be greatly appreciated.
Steve
I'm not sure what patch level you are on, but you should at least be on [Service Pack 2|https://smpdl.sap-ag.de/sapidp/012002523100009038092009E/cr2008win_sp2.exe] and preferably Fix Pack [2.7|https://smpdl.sap-ag.de/sapidp/012002523100005755702010E/cr2008fp27.exe] on top of that.
Also, see [this|] forum thread for a possible solution.
Ludek
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.