By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,678 Members | 2,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,678 IT Pros & Developers. It's quick & easy.

dynamic "group by" change doesn't work

P: n/a
After running my code, group tree(the left section of the report)
changes but not the content in the report.
My code is
----------------------------------------------------------
Private Sub btnModifyGrouping_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles btnModifyGrouping.Click

Dim myReport As New Report1()

Dim crGroups As CrystalDecisions.CrystalReports.Engine.Groups

Dim crGroup As CrystalDecisions.CrystalReports.Engine.Group

Dim crField As
CrystalDecisions.CrystalReports.Engine.FieldDefini tion

'Modify the group to use CustomerName rather than OrderDate

'Get the field to base the group on

crField = myReport.Database.Tables("Customer").Fields("Custo mer
Name")

'Access the group by traversing the groups collection

crGroups = myReport.DataDefinition.Groups

For Each crGroup In crGroups

If crGroup.ConditionField.Name = "Order Date" Then

crGroup.ConditionField = crField

End If

Next

'Refresh the Viewer with the new report object

CrystalReportViewer1.ReportSource = myReport

CrystalReportViewer1.Refresh()

End Sub
---------------------------------------------------------

Any help will be appreciated.

Thanks a lot

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.