Crystal Reports VB.NET - Grouped Report Data Output - How do I change repeating group header text?

Guys and Gals,

I have a Crystal Report in VB.NET (Visual Studio 2003) in which I output data in groups. The report moves to a new page whenever teh group specifier changes. The group specifier is a field called Risk Level and is numbered from 0-6. This field is determined and calculated by the SQL query.

The output should be as follows:

-------Page1 Start-------

Fields header

Group Header RiskLevel = 0

Data  Record
Data  Record
Data  Record etc.

-------Page1  End-------

-------Page2 Start-------

Fields header

Group Header RiskLevel = 1

Data  Record
Data  Record
Data  Record etc.

-------Page2  End-------

-------Page3 Start-------

Fields header

Group Header RiskLevel = 2

Data  Record
Data  Record
Data  Record etc.

-------Page3  End--------

The data is already orderd by the SQL query.

Group headers are repeated on every page should the number of data records exceed a page.

I have it all working but I need to be able to change the Group header text when the Risk Level value changes.

I am a Crystal Newbie. Please help!!!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Insert a group on the risk level. Go to insert on the file menu. Groups.

Pick the group level on the drop down. Select the sort order, ascending, descending

Then go to designer
Right click on the GH1
. Section expert is coming up. Click New Page Before in GH1. This will solve your problem except the first group. If you dont want a new page before the first group, thne click on x2 next to new page before and write Not OnFirstRecord. Save and exit



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
What do you mean change the group header?

I assume you have the risk level in the group header.

Are you wanting the group header to say something different based on the value of the risk level?  
Try using a formula
Open the report
Click NEW (might have to right click formula)
Name - ModGrpHdr
if ({table.RiskLevelField} = 1) then
 "Text you want displayed"
else if ({table.RiskLevelField} = 2) then
 "Text you want displayed for level 2"



To follow up what mlmcc said, after creating the formula you have to assign it to be printed in the group header. Do this by going to the grouping expert and click on the option button "Use a Formula as a Group Name". Then select the formula that mlmcc showed you.


Brian Bischof
<link removed by modulo>
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

WindhoeklaagerAuthor Commented:
Thanks that solved my problem 100%

According to his last comment we solved it.

WindhoeklaagerAuthor Commented:

as noted - the comments did indeed solved my problem. The group header does not repeat (if the same data for that header flows over to the next page) - however the solution does work and is sufficient for my needs. Thanks to the Experts Exchange feedback.

Great website.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.