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

Remove Group from Group Tree

Status
Not open for further replies.

AGIMA

Programmer
Jul 24, 2003
95
AU
I have groupings in my report, and depending on a criteria I want one group to be removed. I can do this on the actual report but I am unable to do this on the Grouping tree.

This is a Web form viewer using vb.net.

Does anyone know how to do this?

AGIMA - professional web hosting is our business.

AGIMA Computing
 
So how do you do this on the actual report, it would be better to state specifics as there are different means.

You might try Report->Selection Formula->Group and place the criteria there.

-k
 
To remove the grouping from the report (i.e. the viewable/body) I simply modify the selection so that if a field is blank then the group is surpressed.

However when the group is surpressed it is not removed from the Group Tree.



AGIMA - professional web hosting is our business.

AGIMA Computing
 
Share some technical info about the data, perhaps you can use the selection formula->record to filter the data, it does remove it from the group tree.

You might also use the TOP N and Other, and not show others to accomplish this.

-k
 
Also, if you're using a group selection, and performing the grouping on the server, you CAN remove the group from the list, but this is dependent upon the data, again, you aren't sharing anything about the data.

-k
 
I have a view on SQL server that has a heap of field, but there are five main fields that I group on.

Group1
Group2
Group3
Group4
Group5

The contents of these groups is:
Group1 contains: Product Categories
Group2 contains: Company names
Group3 contains: Department names
Group4 contains: Product names
Group5 contains: Groups on months purchased
Main data: Transactions

So the Group tree looks like this:
Product Categories
--Company Name
--Department
--Product names
--Months
-Transactions

Now depending on one report I want to display the Department and then I want to remove the Department from the report.

What I am doing now is I simply set the Group test to = "" and the group Supress formula is "If Group test = '' then surpress"

Now when I do this it surpress the Department group on the actually report but on the group tree it will still show the branch but no text.

What I want to do is remove this branch altogeter without modifying the underlying data.

So what I have tried to do is through Code remove the dispose of the group but this didnt seem to work. I also tried to depose of the entire grouping but this also didnt work.


'Load the report
objReport.Load(sReportName)

'Get the groups
Dim aCrystalGroups As CrystalDecisions.CrystalReports.Engine.Groups = objReport.DataDefinition.Groups

'Remove all the groups
objReport.DataDefinition.Groups.Dispose()

Does this help?


AGIMA - professional web hosting is our business.

AGIMA Computing
 
Why not state specifically what you're doing rather than Group test to = ""?

And what does "Now depending on one report I want to display the Department and then I want to remove the Department from the report." mean?

You want it to display and then not display later?

And "depending on one report.."???

Specifics will help.

If it's a specific name or null or blank, remove it using the record selection formula->record

If you show the data, and what you want as a result of the data it should help.

-k
 
Let me put this as simply as I can.

I have a five groups in my report. I want to remove one of these groups in code, using VB.NET.

It doesnt matter what the data is, all I want to do is remove the second group, so the report will only group on four groups and not the orginal five groups.




AGIMA - professional web hosting is our business.

AGIMA Computing
 
You are leaving out a key element--the content of your "group test" formula--please share.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top