Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Select formula for hierarchial records Post Reply Post New Topic
Author Message
jrbledsoe001
Newbie
Newbie


Joined: 24 Jul 2012
Location: United States
Online Status: Offline
Posts: 2
Quote jrbledsoe001 Replybullet Topic: Select formula for hierarchial records
     Posted: 27 Jul 2012 at 6:23pm
I am working with records of web application forms and the items on the forms.  My report needs to list a parent record and all corresponding linked records.  The records are indexed by a hierarchical field.

The parent web form ID is identified as the field tree entry ID.  This record has a hierarchy field with levels.  The child records have a unique entry id, the hierarchy field of the parent record plus the additional levels (0-6).  I'm uploading the report with data and a sample of the parent and detail records of one form.  

I need to create a text column for the child records which displays the text description of the corresponding parent record.   I want to use this text description as a parameter which the user can select.  The levels will vary so I can't assume that the parent id will always equal level two in the sample data.

Here is a snap shot of the data
 
TREEENTRYID,ENTRYPARENT,ENTRYSTRING,LVL,HIERARCHY,LVL_0,LVL_1,LVL_2,LVL_3,LVL_4,LVL_5,LVL_6
7890,11,Sample Dashboard,2,.8.11.7890.,8,11,7890,NULL,NULL,NULL,NULL
7891,7890,My Reports,3,.8.11.7890.7891.,8,11,7890,7891,NULL,NULL,NULL
7896,7890,Personalized Links,3,.8.11.7890.7896.,8,11,7890,7896,NULL,NULL,NULL
7897,7896,MyHomePage,4,.8.11.7890.7896.7897.,8,11,7890,7896,7897,NULL,NULL
7898,7896,WebMail,4,.8.11.7890.7896.7898.,8,11,7890,7896,7898,NULL,NULL
8264,7896,My Benefits,4,.8.11.7890.7896.8264.,8,11,7890,7896,8264,NULL,NULL
7899,7890,Administration,3,.8.11.7890.7899.,8,11,7890,7899,NULL,NULL,NULL
7900,7899,Services Administration,4,.8.11.7890.7899.7900.,8,11,7890,7899,7900,NULL,NULL
8681,7899,IT Department Reports,4,.8.11.7890.7899.8681.,8,11,7890,7899,8681,NULL,NULL
7918,7890,Payroll,3,.8.11.7890.7918.,8,11,7890,7918,NULL,NULL,NULL
7919,7918,Payroll Department Reports,4,.8.11.7890.7918.7919.,8,11,7890,7918,7919,NULL,NULL
7921,7918,Payroll Reports for Managers,4,.8.11.7890.7918.7921.,8,11,7890,7918,7921,NULL,NULL
7923,7890,Human Resources and Benefits,3,.8.11.7890.7923.,8,11,7890,7923,NULL,NULL,NULL
7924,7923,HR Department Reports,4,.8.11.7890.7923.7924.,8,11,7890,7923,7924,NULL,NULL
7925,7923,HR Reports for Managers,4,.8.11.7890.7923.7925.,8,11,7890,7923,7925,NULL,NULL
7935,7890,Financials,3,.8.11.7890.7935.,8,11,7890,7935,NULL,NULL,NULL
7937,7935,Finance Department Reports,4,.8.11.7890.7935.7937.,8,11,7890,7935,7937,NULL,NULL
7938,7935,Financial Reports for Managers,4,.8.11.7890.7935.7938.,8,11,7890,7935,7938,NULL,NULL
jrbledsoe001@yahoo.com
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 31 Jul 2012 at 3:20am
either you need to stored the values of previous levels or use a stored proc to return a 'super' record with the values of the parent for every level assigned.  CR doesn't handle this type of data well, as all the data is in 1 table.
 
You can try self joins in the tables for CR but again CR will probably have a hard time doing this.
 
Stored proc or external processing of the data is probably going to be your best bet.
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum