Recursive table in Crystal Reports

Hi,
 
      Can anyone help me to print recursive table in crystal report 8.5? I have a table in Sql Server which is recursive.(Id is primary key & parentId is the foreign key).I want to sent any Id to crystal report & it should print all the child nodes of that Id.(something like a treeview in vb)
rkvkAsked:
Who is Participating?
 
AHMKC1Connect With a Mentor Commented:
if you use Crystal Report control then in you report file create a paramenter field (paramID) on field ID

Then on your form write follwing code

CrystalReport1.ReportFileName=Your report File Path
CrystalReport1.ParameterField(0)="ParamID;"& textID.Text & ";True"
CrystalReport1.Action=1
0
 
RPannettCommented:

  If you have a fixed number of recursion levels, then you can treat it like a "self-join" - create a separate aliase (reference, whatever..) to the table for each level of recursion.

  Or..is your question more how to get the display of the report to work the way you want?  In Crystal, each level could be a "group" based on a different table reference if you used my idea above..
0
 
rkvkAuthor Commented:
hi,

 Sorry its not fixed number of recursion.When I pass the Id it should get all of its children as groups in the reports.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
RPannettCommented:
I see! Unlimited recursion in Crystal reports is beyond my experience, sorry!
0
 
AHMKC1Commented:
If you use Crystal Report Viewer Control then you can do it by define Recordset

"Select * From Table Where ParentID=" & textID.Text & ""

set this recordset as report recordset

0
 
rkvkAuthor Commented:
let me trt it & get back to you
0
 
rkvkAuthor Commented:
hi,
 
 Sorry am not using viewer control
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.