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!

Dynamic Grouping In Crystal Reports 8.5

Status
Not open for further replies.

JackDev

Programmer
Apr 10, 2003
2
0
0
US
How do I programatically change the group based on what the user selects in the parameter dialog box?
 
Do you have an example? I am new to crystal reports.

Thanks
 
Jack,

Email me (ixm7@psu.edu) and I'll send you a report (using the sample database that comes with Crystal) that demonstrates the technique.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Let us say you have a Parameter with 3 options

"1", "2", "3"

you create a formula using this form

@Grouping1

if ?Param = "1" then
{table.field1}
else if ?Param = "2" then
{table.field2}
else if ?Param = "3" then
{table.field3}
else
{table.field??} ; // a default option for improper input

MAKE SURE ALL VALUES ARE OF THE SAME TYPE!!! I usually use strings and convert numbers to strings. Using strings also allows you the option of not having a group at all....all you do here is make the "else" value a constant.

Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top