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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I group by dynamically?

Status
Not open for further replies.

PavanKumarU

Programmer
Jan 31, 2003
56
US
Hi everyone,
Got a question thats troubling me.
This is what i want to do:
We have a report and it is not grouped by Country, State,
City and Zip Code. What my users ask is to be able to specify a county name in place of zipcode...i.e they want to have an option to be able to select(or enter) EITHER zip code or county name, and i have to group the rpeort on their selection. Is this possible? I asked one of my coleague and he says its possible by writing a group formula.
Moroever we are connecting to the database using stored procs. If i add a new parameter to the report should i change the stored procedure?
Any help is much appreciated.
Thanks,
Pavan
 
One alternate way of dealing with your dynamic grouping issue would be to make use of some external coding (be it something like Delphi or VB).
I've created scenarios like this whereby my report would have a simple Group field and on top of that I would add additional group(ings) from my external code so that the user might list contact names in either age or surname order for example.
However this suggestion only proves fruitful if you're familiar with this kind of idea or can convince a colleague that its worth doing for you. :)
Steve
 
Create a {?GroupBy_Parm}.

Have a Formula such as:
----------------------------------------
IF {?GroupBy_Parm} = "By ZIP" THEN {ZIP} ELSE {COUNTRY}
----------------------------------------
Group the report on that Formula.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Dear Ido,
Thank you very much. Thats exactly what i am looking for and it did really work. I dont have words to express my gratitude.
Thanks a ton.
and Steven, thnaks you too. Bu, I am just not familiar how i can attach my report with any external code. We are calling these reports from a web page (html) and passing the params to the reportlauncher web control.
Thanks again.
--Pavan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top