Greetings All:
I am using Crystal Reports XI Release 2 with VB .NET 2005 and Oracle 10g. I never use the integrated report designer for VB. NET - I design the reports in the stand-alone Crystal Reports environment, then add them to VB .NET assemblies. I have applied the update for Visual Studio .NET 2005.
I would like to create a group that dynamically uses one of several different sorts based on a column value in the dataset that's passed to the Crystal Reports .rpt object at runtime. The column, called "Claim Sort Type", is a string that's stored in a site profile type of table in the Oracle database, then retrieved along with the other data for report and included in the dataset that's passed to the Crystal Reports .rpt object at runtime. Every row in the resultset will have the same value for Claim Sort Type, by definition. The possible values for Claim Sort Type are:
"EOB Number, Ascending"
"Document Number, Ascending"
"Document Number, Descending"
(EOB Number and Document Number are string column values that are also part of the dataset that is passed to the Crystal Reports .rpt object at runtime)
Within a subreport, I would like to create a group that contains claim information, sorted based on this column value. To this end, I have created a formula, "EOBNumOrDocumentNum", which is populated with either EOB Number or Document Number based on the value of Claim Sort Type. This works, but the sort is either always ascending or always descending. Choosing always ascending allows two of the three Claim Sort Types to work. but now I need to find a way to add a dynamic group sort that is descending.
Posts I have read in other places and intuition have led me to the "Use a Formula as Group Sort Order" check box, but when I check this and click the formula button, the only field available for use in the formula is the formula field that links the subreport with the main report. I don't want to use a parameter in the formula for the group sort, because the user isn't going to have the opportunity to specify the group sort - it's specified by the Claim Sort Type column in the site profile table.
If the group sort formula can only access parameters and the one formula used to link the subreport and the main report, the group sort formula feature seems to be of limited usefulness. Is there any way for the group sort formula to access other formulas or data fields?
As an aside, every time I type the curly bracket character "{" in the group sort formula window, I get an exception that reports "Crystal Reports has encountered a problem and needs to close."
Thank you,
Bob
Edited by wanderingbob - 08 Feb 2008 at 3:24pm