Print Page | Close Window

PlusMinus Sign on parent row without child rows

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=17783
Printed Date: 15 November 2024 at 6:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: PlusMinus Sign on parent row without child rows
Posted By: Katrien
Subject: PlusMinus Sign on parent row without child rows
Date Posted: 13 January 2011 at 10:32am
Hey,
I'm new to CJ and what I'm trying to do is showing a lot of records into a Report Control (5000), each of them has at least 2 child records.
If I build the report, it takes a while to build, so I thought, if I can build the report with only the Parent records that gives me an acceptable build time. I want to have the + sign in the first column, and only if i press the + then I query the database for the child records and add them to the report.
 
The result is the same, but loading time, is speed up a lot.
 
Can someone give me a tip.
 
1/ The first thing I need to know is how to force the Row to show the + sign if there are no child record underneath?
 
2/The event that fires when the + sign is pressed, so I can add the child records before expanding
 
Greetings
Katrien
 
 



Replies:
Posted By: Aaron
Date Posted: 17 January 2011 at 2:14pm

Hi,

I have few questions:

  • How long does it take before all records are loaded?
  • How many columns do you have?
  • How do you add records?
  • Do you call .Populate everytime you add one record?

Please let me know and I'll see what I can do to help. 5000 records should be loaded in a split second. I have reports were >100000 records are added (with few columns but still...)

   


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Katrien
Date Posted: 18 January 2011 at 2:24am
Dear Aaron,
 
The problem of speed is not a Codejock Problem, I have to search for data in different databases in multiple tables and that takes time.
 
To reduce the time for the end user I thought to load the Parent records with the Plus Sign already shown, and when the user clicks the sign, then go look for the child records and add them.
 
The way I do it know is when I add a parend record, I add a empty dummy child record, so that the + sign appears. When the user clicks on the +, then I delete the dummy child record and add the real child records.
 
this means that i only need the time for building the child records for the parents where I'm intrested in.
 
But I wonder if there is a property so I can force the parent record to show the + sign, without al the workaround stuff.
 
Regards


Posted By: Aaron
Date Posted: 28 January 2011 at 2:08am

Hi,

I don't see a way to force plus/minus sign to show. It is controlled by TreeColumn property but this property is set for entire column. If you could set it seperately for each record it would be no problem.

The only thing you could do is remove the + and - Icon from .Glyphs collection and assign expanded/collapsed icon in BeforeDrawRow event.
 
Something like this:
 
With Me.wndReportControl
        .Icons.AddIcons Me.wndReportControl.PaintManager.Glyphs
       
        .PaintManager.Glyphs.RemoveIcon 0
        .PaintManager.Glyphs.RemoveIcon 1
End With
 
Private Sub wndReportControl_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
    Metrics.ItemIcon = IIf(Row.record.Expanded, 0, 1)
End Sub
 
 
 
Good luck Wink
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Aaron
Date Posted: 28 January 2011 at 9:15am

Hi,

I forgot to mention to set:

wndReportControl.SetCustomDraw xtpCustomBeforeDrawRow

in order to 'activate' BeforeDrawRow event

A little more info on above code:
This event fires whenever RC needs to be redrawn (mouseclicks, scrolling etc etc) so the icon 'expanded' shows only when a row is really expanded and to expand a row you need childs otherwise its just an ordinary row. Because you removed + / - icon (from .Glyphs collection), the row responds to a single click and you are able to fill the record with the childs. You have to check if you added childs already of course or another option is (when row is collapsed) remove its childs again. Basicly same way as Windows Explorer works, + sign is always present even when the folder is empty. Only clicking the folder wil update icon.
 
Hope this helps  Wink
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net