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

Gouping On A SubString of the GroupKey?

Status
Not open for further replies.

Mickel

IS-IT--Management
Jan 21, 2003
3
NZ

I am trying to create a cost of contractors report for my pulp and paper factory. The contractor costs are to be grouped into locations within the pulp mill.

The location code is something like this AABBCCCC. The A's are sites, The B's Are major locations and the C's are specific locations.

I want to group contractors cost's on the major locations, ie just the B's. I thought you could do this using the GetKeyValue() function and then somehow return a substring of the location code as the groupkey value. The report doesn't even seem to call the GetGroupKey() function when it runs. Why is this?

I Don't know if what I am trying to do is possible as I am new to both Actuate and Programming. There seems to be a severe lack of third party support material relating to actuate. Actuates manuals seem to have been written with a clear focus on protecting their own consulting revenues. Has anyone had any luck getting access to the user forums on their support site?

Thanks for any help given

Michel Black
 
You need to do the following

1) Create a instance variable on the datarow and name it qCustomGroup
2) In the OnRead Method, get the substring that denotes the BBB's that u want to group on
3) Instead of just AcSQLQuerySource (or any similar component) You shall have AcMemoryDataSorter Component and then your regular Datasource.
4) In the START() Method of the AcMemoryDataSorter Add the following lines before the SUPER::START()

SortPairArray.RemoveAll()
'** here we should add all the group keys in the same order
'** of their nesting in the report and other sorting
'** required. For now I am expecting you have only one
'** custom group.
AddSortKey("qCustomGroup")
Sort()
Rewind()

5) For the group section make the key as qCustomGroup.

Voila!! You have the result you want
 
Thanks for that Kuppaa.

I did manage get it working by basing the groupkey on a computed field created in the graphical query editor.

Your methods looks like it will allow me to display the whole location code instead of just the substring of each group which is preferable.

Thanks Heaps.

You Don't happen to know how to calculate a subtotal at the end of each group and then a overall total at the end of the report do you?

Thanks

Michael Black
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top