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 strongm 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 reg.

Status
Not open for further replies.

elangesk

Technical User
Jun 10, 2005
7
IN
Hai...

I have different fields in a table on SQL Server , so i want to create a crystal Report with grouping that report under selecting the field name as a parameter at run time , the report will be grouping based on the Field Parameter as Dynamically on the Report.

I expect ur Valuable helps and also thanks for pervious reply.
 
Create as many formulas fields as you need and then depending on the value of the input parameter you assign a field value to each formula

@SortBy1
if @Param = 1 then
{MyTable.field1}


@SortBy2
if @Param = 2 then
{MyTable.field2}

group by each sortby formula and then let crystal do the rest.



Mo
 
You could use one formula, as long as you convert fields to the same datatype. If you set up a string parameter with options like "date", "amount", "company", then you can create a formula like:

select {?parm}
case "date" : totext({table.date},"yyyy/MM/dd")
case "amount" : totext({table.amount})
case "company" : {table.company}
default : ""

Then insert a group on this formula.

-LB
 
But then you might not be able to sort according to their original datatypes

another benefit of different formulas is that you can have different sorting order

Mo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top