PlusMinus Sign on parent row without child rows |
Post Reply |
Author | |
Katrien
Newbie Joined: 10 January 2011 Status: Offline Points: 2 |
Post Options
Thanks(0)
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
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi, I have few questions:
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.... |
|
Katrien
Newbie Joined: 10 January 2011 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
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
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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
|
|
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.... |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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
|
|
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.... |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |