[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

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!!!
0
Windhoeklaager
Asked:
Windhoeklaager
2 Solutions
 
ebolekCommented:
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

Regards

Emre
0
 
mlmccCommented:
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 INSERT--> FORMULA
Click NEW (might have to right click formula)
Name - ModGrpHdr
Formula
if ({table.RiskLevelField} = 1) then
 "Text you want displayed"
else if ({table.RiskLevelField} = 2) then
 "Text you want displayed for level 2"

etc

mlmcc

0
 
bischofb_CRNETCommented:
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.

HTH,

Brian Bischof
<link removed by modulo>
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
WindhoeklaagerAuthor Commented:
Thanks that solved my problem 100%

Windhoeklaager
0
 
mlmccCommented:
According to his last comment we solved it.

mlmcc
0
 
WindhoeklaagerAuthor Commented:
Guys,

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.

Cheers

Windhoeklaager
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now