[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1253
  • Last Modified:

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)
0
rkvk
Asked:
rkvk
  • 3
  • 2
  • 2
1 Solution
 
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
 
RPannettCommented:
I see! Unlimited recursion in Crystal reports is beyond my experience, sorry!
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
AHMKC1Commented:
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now