Click to See Complete Forum and Search --> : passing field for group


mis1411
November 13th, 2008, 01:50 AM
dear all
iam using crystal report 7
vb6 programming


i need to know if there any way to make group by passsing field to my report

for example if i need to make report with the same data
for group by date
and some time group by location

i will make 2 reports for this and call them as the user select


now is there any way to change the group from the code and effect the data inside the report

so i will not make omre than report it will be one report and many groups i pass the group from the code



best regards

Ned Pepper
November 14th, 2008, 01:00 PM
You can group on a formula. The only restriction is the formula must always return the same datatype. A formula something like below will work, then insert a group.

dim OutPut as string

select case {MyInputParameter}
case "ByDate"
OutPut = CSTR({aDateField})
Case "ByString"
OutPut = {aStringField}
Case "ByNumeric"
OutPut = CSTR({aNumField})
End Select

Formula = OutPut