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

How to programatically change group condition in a CrossTab

Status
Not open for further replies.

pss08

Programmer
Mar 10, 2006
7
ES
How can I programatically change the group condition of a CrossTab report that is a date field located in the column list of the CrossTab assistant.
For example from "monthly" to "weekly".
It seems that in a CrossTab, could not be used the usual way of changing a group condition:

Report.Areas.Item("GH1").GroupCondition = crGCMonthly

Does anyone know how to do it



 
If you define a group using a formula field, you can then change the nature of that group using a parameter. E.g.
Code:
If @choice = "W" then ToText({your.date}, "yyyy/MM")
else ToText({your.date}, "yyyy") & "/" & DatePart("ww", {your.date})

WHether you can then use such a group in a Crosstab depends on your version of Crystal.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
This is not what I am asking for. As explained before, when you design a simple CrossTab report using the assistant (CR9 in my case), if in the columns list of the assistant you put a date field, you have the option to print the results dayly, weekly, monthly, etc.
You do not need any formula to do it.
In a report that is not a CrossTab, I do it programatically in the following way:

Report.Areas.Item("GH1").GroupCondition = crGCMonthly
Report.Areas.Item("GH1").GroupCondition = crGCDayly, etc.

What I want to know if such a method is available for CrossTabs, or how can I do the same.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top