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

Use of multiple accum/display/reset fields

Status
Not open for further replies.

smmedeiros

Technical User
Feb 21, 2008
74
US
Looking for guidance.
I have a need to pull configuration item (CI) information.
I have many CI's with multiple providers and dependants.

I want to display on single row a provider field (comma delimited) and a dependant field (comma delimited)

ex.
server1 - dependant1,dependant2 - provider1,provider2, provider3
server2 - dependant1 - provider1, provider2
server3 - dependant1, dependant2, dependant3 - provider1


I have used the accum/display/reset.
My issue that i cannot resolve is that i have a variable number of dependants or providers at any given time.

i'm using 2 distinct sets of accum/display/reset. I can get the expected data collection in each independantly, however, when trying to use both 'display' fields on the same row, i get repeating information in one of the displays

i've tried grouping in this order
server
provider
dependant

i've set my reset value for provider in the server group
i've set my reset value for dependant in the provider group

i'm displaying my content in group footer for server.

my results are:
server - depandant1,dependant2 - provider1,provider1,provider2,provider2,provider3,provider3

my desired output is:
server - depandant1,dependant2 - provider1,,provider2,,provider3

can anyone offer guidance for using multiple accums with variable number of records?
 
If I understand this correctly, there is no heirachy from dependent to provider. If that's tru this can be done with shared variables.

I would just group on server, then have separate formulas that build strings of dependents and providers.
then in the group foorer build a string that appends Server & dependent string & provider string.
 
Charliy -
Thank you for this idea. Can you offer a sample on how to do this?
 
formula 1 {@init} placed in report header and Group 1 footer B
shared stringvar prov := ' ';
shared stringvar depn := ' ';

formula 2 {@getpro} placed in detail
shared stringvar prov ;
if {table.provider} in prov
then prov := prov
else prov := prov & ", " & {table.provider}

formula 3 {@getdep} placed in detail
shared stringvar depn;
if {table.dependent} in depn
then depn := depn
else depn := depn & ", " & {table.dependent}

formula 4 place in group footer 1A
shared stringvar depn;
shared stringvar prov;
{table.server}&": "& depn & prov

 
Thank You Charliy -
worked great as you have described.
I made a slight modification to have 2 independant columns one for dependant and one for provider, also removing reference to the server name.
my only remaining item is, how to i remove the comma that is showing up as the first charater of each field..

GETPRO modified as
shared stringvar prov ;
if {Provider CI.resource_name} in prov
then prov := prov
else prov := prov & ", " & {Provider CI.resource_name}

formula that sits in group footer
shared stringvar prov;
prov

results as
, AUMLB9-01ND02, AUMLB9-01ND01, MEL DH3 A21

any thoughts to remove the first comma ?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top