Populate report control on demand  
       
      Printed From: Codejock Forums
        Category:  Codejock Products
       Forum Name:  Suite Pro
       Forum Description:  Topics Related to Codejock Suite Pro
       URL: http://forum.codejock.com/forum_posts.asp?TID=1598
       Printed Date: 04 November 2025 at 11:12am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
      
 
  
      Topic: Populate report control on demand
       
      Posted By: amorton
       Subject: Populate report control on demand
       Date Posted: 29 December 2004 at 12:56pm
       
      
        
          
	
I'm new to these controls and am trying to work out if there is a way
to populate the report control on demand, when using the report in tree
mode or list mode with grouping.  
 
For example I have a list of parent items and each parent has a list of
child items. I populate the list initially with 1 child from each
parent (this is just as a holding item so the parent is represented in the list) and group the list by the
parent name.  After calling Populate I then collapse all the group
rows in the control and show the form, so i have a list of collapsed groups which the user can then choose to expand. 
 
Then when the user expands the group row i want to retrieve the rest of
the children for that parent from the database and add them to the
report control. I've done this sort of thing many times before using a
standard tree control.  
 
There is no "Expanded" event  that i can see, even when the control is working as a tree. This would be *really* handy. 
 
I have experimented with using the "BeforeDrawRow" event to catch that
the "holding" item is about to be drawn and then retrieve the items
from the db. If i then call the "Populate" method from within the event
handler it crashed vb with a "memory could not be read" error.  
 
I'm really impressed with all of the controls in general, but really
need to be able to populate the report/list/tree on demand. It i can't
do this it may sink some of my app designs.  
 
Any suggestions or help would be appreciated. 
 
thanks 
 
          | 
         
        
      
 
  Replies: 
       
      Posted By: bbb127
       
      Date Posted: 04 May 2006 at 5:59am
       
      
        
          
	
I am also interested in using the Report control in an application
similar to this. The database contains tens of thousands of records
that I want to load on demand. If the user chooses to group by a
column, I want to display all the groups (collapsed) and then only load
the data when a particular group is expanded. Can the Report control
handle this and what would be the basic steps I would need to do in
order to implement it.  
 
Also, when using the BeforeDrawRow event, is it possible to detect the
difference between when the user has moved their mouse over a
particular ReportItem and when the user has scrolled, making more rows
come into view? 
          | 
         
        
        
       
      
     |