Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - PlusMinus Sign on parent row without child rows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

PlusMinus Sign on parent row without child rows

 Post Reply Post Reply
Author
Message
Katrien View Drop Down
Newbie
Newbie


Joined: 10 January 2011
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Katrien Quote  Post ReplyReply Direct Link To This Post Topic: PlusMinus Sign on parent row without child rows
    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
 
 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
Katrien View Drop Down
Newbie
Newbie


Joined: 10 January 2011
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Katrien Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.