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

Displaying a tree, dynamic grouping

Status
Not open for further replies.

ScottGS

Programmer
Aug 2, 2001
27
0
0
US
Hi,

I will be building a report using the Automation Server to be run from within VB. I will need to report the contents of a tree, such as a directory structure. The tree can have any number of levels, and any number of children per node. I am looking for ideas on how to approach this in Crystal.

I have some sample code for saving and loading a tree to a file. I believe it could be modified to traverse the tree and build a linear recordset that I can feed to Crystal.

One idea I've contemplated is to create grouping on the fly, one nested group for each level in the tree. Some potential problems with this are performance, and running up against some upper limit as to the number of groups. I don't know if there is one, and if so, what it is. Also there is a finite width to the page, so indenting groups can only go so far and still have a usable output.
One advantage of this method is it would make use of Crystal's drill-down functionallity to see whatever level of detail the user wants.

Does anyone have any ideas about whether this would be practical, or any other approaches that might work? I could use the Report Designer Component if it has some control that would be useful. I've never used it so there would be a learning curve, and it would deviate from the architecture that is already in place with other reports built for this application. I'd rather avoid that if possible.

Is there any mechanism to include Active-X controls within a Crystal Report, such as in a subreport? If so, then I could use the same tree control that the application uses to allow manipulation of the data.

Scott


 
Crystal needs to be able to connect to some type of table. It can't generate the table within the report and then report on it. However, if your Active-X component can generate a recordset, you could use it in your app, and then pass the recordset to the report. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

Yes, I can generate the recordset to pass to Crystal. The problem is representing a tree structure in the report. Indeed, the tree is already stored in a database so that part is taken care of.

Scott


 
CR has a heirarchical grouping feature which sounds like what you need. To get it to work you need two fields, one in each record that points to it's parent. Check the help on it and see if that will help. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top