Thank you for any help provided in advance.
Specs:
Database: Access
Crystal Reports: Version 9 Developer Licence with VS.net I believe it is Upgrade
IDE: Visual Studio 2005
Ok, I got this project that is done in VB6 there are about 6 reports or more. That programmer used code to modify his reports at RunTime. He has used code like this:
STARTCODE: (Don't know the tag)
If optSortbyDate.Value = True Then
Report1.GroupCondition(0) = "GROUP1;{@ActivityDate};DAILY;A"
Report1.SortFields(0) = "
+{@ActivityDate}"
Report1.SortFields(1) = "+{ActivityLog.Id}"
ElseIf optSortbyUser.Value = True Then
Report1.GroupCondition(0) = "GROUP1;{ActivityLog.UserId};ANYCHANGE;A"
Report1.SortFields(0) = "+{ActivityLog.UserId}"
Report1.SortFields(1) = "+{ActivityLog.Id}"
ElseIf optSortbyNetw.Value = True Then
Report1.GroupCondition(0) = "GROUP1;{ActivityLog.NetwUser};ANYCHANGE;A"
Report1.SortFields(0) = "+{ActivityLog.NetwUser}"
Report1.SortFields(1) = "+{ActivityLog.Id}"
End If
ENDCODE:
I managed to do three things. One change the database connection:
ReportCls.DataSourceConnections.Item(0).SetConnection(
"", mdbFileName, False)
Second, change a string in a formula field:
ReportCls.DataDefinition.FormulaFields.Item("Period").Text = """From StartingDate to Ending Date yadayada"""
Third, Change the selection formula.
ReportCls.DataDefinition.RecordSelectionFormula = "{@ActivityDate} >= " & "DTSToDate ('2007/1/1')" & " AND " & "{@ActivityDate} <= " & "DTSToDate ('2007/12/12')"
The problem lies with the grouping part. There is a set of 3 radiobuttons that specify how is the grouping to be done. I have looked through the ReportClass to no avail on how to change it.
I got about 5-8 more of these, do you also think I should quit? Again thanks for the help.