Hi All!
I have an interesting situation. I have a report with 3 groups. Group1 is based on a field from a database table (say, county.countyId). The report prints correctly and I'm happy, but I need to create the exact same report having the first group based on a field from a different table (say, city.cityId).
It works sort of like this: I have a table containing (among others) the following fields:
1 - countyId (which points to the 'county' table)
2 - cityId (which points to the 'city' table)
3 - stateId (... state table)
4 - and so on...
Group 1 of the report I have right now is based on countyId, and records are nicely grouped by county. However, the user has the choice to print by city, by state, and by other fields whose structure is exactly the same as county.
I could simply save the new report with a different name and just change Group 1 to base it on cityId, and then do that again for stateId and the others, but then I would wind up with 5 different reports which are essentially the same, but that differ only in the way they're grouped.
Thus, the question is: Can I change the field a group is based on at runtime so that I only create 1 report and print it based on the user selection?
I'm using Crystal Reports 10.0 and I'll be instantiating the report from C#.
Thanks!
JC
_________________________________________________
To get the best response to a question, read faq222-2244.
I have an interesting situation. I have a report with 3 groups. Group1 is based on a field from a database table (say, county.countyId). The report prints correctly and I'm happy, but I need to create the exact same report having the first group based on a field from a different table (say, city.cityId).
It works sort of like this: I have a table containing (among others) the following fields:
1 - countyId (which points to the 'county' table)
2 - cityId (which points to the 'city' table)
3 - stateId (... state table)
4 - and so on...
Group 1 of the report I have right now is based on countyId, and records are nicely grouped by county. However, the user has the choice to print by city, by state, and by other fields whose structure is exactly the same as county.
I could simply save the new report with a different name and just change Group 1 to base it on cityId, and then do that again for stateId and the others, but then I would wind up with 5 different reports which are essentially the same, but that differ only in the way they're grouped.
Thus, the question is: Can I change the field a group is based on at runtime so that I only create 1 report and print it based on the user selection?
I'm using Crystal Reports 10.0 and I'll be instantiating the report from C#.
Thanks!
JC
_________________________________________________
To get the best response to a question, read faq222-2244.