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

Get Group Name on Drill Down

Status
Not open for further replies.

crimsntyd

Programmer
Sep 27, 2005
55
US
I'm trying to launch a second report in VB (viewer) when the user drills down on a group name in the viewer. I need to pass the group name to the next report, but I'm having great difficulty getting the syntax for retrieving the name. Here's the code I've been able to piece together:

Dim GR As ReportObjects
Set GR = CRReport.Areas("GH1").Sections(1).ReportObjects
LRU = GR("GroupName").Field.GroupNameFieldName

...Where "LRU" is the value I'm trying to pass on to the next report. Is there something wrong with this code? Thanks in advance.
 
More info. I got the code to work by changing "GroupName" to "GroupNamePartNumber1". But the code returns "Group #1 Name", not the actual value that I drilled down on. I need to pass the actual value that I drill down on. Hope that helps.
 
OK, MORE info. I know this much:

Dim GR As CRAXDRT.FieldObject
Set GR = CRReport.Sections("GH1").ReportObjects(1)
LRU = GR.Field.Value

...but I'm not getting anything for LRU. If I put "Name" in place of "Value", it gives me {WarrantyFinal.LRU}, which is the name of the field (duh). What's wrong here?
 
So, you want the VALUE of the current group field that's being drilled down on?

Try adding a DrillOnGroup event for your CRViewer, then stick this bit of code in it, and see if it returns the value you're looking for:

Debug.Print GroupNameList(0)

It should return the value of your group field, but if you've set the group up to use a different value for its name, that value will print instead of the original group field value.

-dave
 
Thanks. I already had the DrillOnGroup event. Sorry I didn't put it in the previous post. I'll try it at work first thing in the morning.
 
I got a type mismatch when I put your code in the DrillOnGroup event. Any idea why? Thanks...
 
Not sure. What's the group field's datatype? How many layers of grouping are involved? I'd never attempted to access the GroupNameList in the DrillOnGroup event until trying to find a solution for your issue, so it could be anything, but post as much detail as you can about your grouping, and I'll try to duplicate your situation.

I'm on my way out of town and not sure if I'll have internet access until Saturday, but post away - and perhaps someone else can get involved as well.

-dave
 
Thanks for your help. I found out when looking at this document:


...that the .value property won't work unless the section event is formatting active. Check out page 181 and the example on pg. 238 to see what I'm talking about. This document is HUGE, and has everything you need to know about properties, I just wish it had more syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top