Print Page | Close Window

Dynamic Grouping possible ?

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6740
Printed Date: 06 May 2024 at 11:18am


Topic: Dynamic Grouping possible ?
Posted By: TkNeo
Subject: Dynamic Grouping possible ?
Date Posted: 16 Jun 2009 at 7:32am
I have 3 columns in my table. I want the report to group by any one of the 3 columns and the user should be able to decide that at run time.

So in my winforms code i have a combo box that lets them select one of the three options and then i am hoping i can set the group by criteria at run time.

Anyone know how to do this ?

Thanks


using CR for VS 2005



Replies:
Posted By: lockwelle
Date Posted: 23 Jun 2009 at 6:38am
create a formula like:
if {?parameter} = "x" then
  {table.field1}
else
 if  {?parameter} = "y" then
  {table.field2}  etc
 
Then for set the group to the formula.  Brian covers this in his book...main reason that I watch this site and not other.  This one concept has made my reports so much more than they were.
 
HTH


Posted By: TkNeo
Date Posted: 23 Jun 2009 at 8:04am
you know group by "formula" does not appear to be an option in my version of crystal report, which is CR VS 2005.

However i had a trial version of CR VS 2008 and it was an option there.

Do you think its possible or am i doing something wrong ? or is it just an older version issue.




Posted By: lockwelle
Date Posted: 23 Jun 2009 at 8:20am
Hmmm....I think that there some confusion.  Since I am using CRXI in a VS2005 environment....but this is really a bit of a red herring.
 
Create the formula.  Now create a group or change an existing group, in the upper drop down, just scroll down until you see your formula, select it and you're done.
 
HTH


Posted By: TkNeo
Date Posted: 23 Jun 2009 at 8:28am
Originally posted by lockwelle

Hmmm....I think that there some confusion.  Since I am using CRXI in a VS2005 environment....but this is really a bit of a red herring.
 
Create the formula.  Now create a group or change an existing group, in the upper drop down, just scroll down until you see your formula, select it and you're done.
 
HTH


ok, this is what i am doing. create a formula. open report->group expert. FORMULA DOES NOT SHOW UP.

so annoying !



Posted By: lockwelle
Date Posted: 23 Jun 2009 at 12:00pm
next thing that I would try, would be to drop the formula on the report and see if it displays as expected.  I've never used the group expert, but having just played with it, if the the formula is empty or doesn't contain a field, then it doesn't appear.  I put a field in it, saved and there it was.
 
HTH


Posted By: TkNeo
Date Posted: 23 Jun 2009 at 12:10pm
you were right on.

thanks very much.. i cant believe i could not figure this out :) so dumb





Print Page | Close Window