Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using parameter to change grouping

Status
Not open for further replies.

purtman

Programmer
Jan 15, 2002
3
0
0
US
I am writing a report in Crystal Reports 10. I want to add a parameter to give the users the ability to group and/or sort by a parameter. How do I use a parameter to give the user this functionality? Thanks.
 
There's some trciks to doing so based on different data types:

So fill the parameter with the names of the fields they might group by.

Now create a formula like:

if {?GroupParm} = "Zip" then
{table.zip}
else
if {?GroupParm} = "State" then
{table.state}
etc...

If the data types are different you'll need to adjust for them.

I should probably write up a FAQ on this as numerics and dates present interesting challenges.

-k
 
Thanks! I'll give it a shot here in a bit.
 
Basically the numerics would use something like:

picture(totext({table.integer},2,""),"000000000000")

Dates would be:

totext(currentdate,"yyyyMMdd")

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top